# AS2 creating objects in a for loop

**URL:** <https://forum.kirupa.com/t/as2-creating-objects-in-a-for-loop/221543>\
**Category:** flash\
**Created:** [April 5, 2007, 1:21am UTC](https://forum.kirupa.com/t/as2-creating-objects-in-a-for-loop/221543 "2007-04-05T01:21:45Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ajcates](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/ajcates/32/2435_2.png) [@ajcates](https://forum.kirupa.com/u/ajcates)\
**Post date:** [April 5, 2007, 1:21am UTC](https://forum.kirupa.com/t/as2-creating-objects-in-a-for-loop/221543/1 "2007-04-05T01:21:45Z")

</div>

This piece of code gives me an error because i have an equation on the left side of the equal sign, logically it makes sense, but flash doesn’t like the code how would i do some thing like this?

```auto

for (i=1; i<=10; i++) {
    eval("dynamicObject"+i) = new Object();
}

```
