# Question about Instance Names

**URL:** <https://forum.kirupa.com/t/question-about-instance-names/290319>\
**Category:** flash\
**Created:** [June 12, 2009, 4:45pm UTC](https://forum.kirupa.com/t/question-about-instance-names/290319 "2009-06-12T16:45:15Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hazelvine](https://avatars.discourse-cdn.com/v4/letter/h/ecd19e/32.png) [@Hazelvine](https://forum.kirupa.com/u/Hazelvine)\
**Post date:** [June 12, 2009, 4:45pm UTC](https://forum.kirupa.com/t/question-about-instance-names/290319/1 "2009-06-12T16:45:15Z")

</div>

Ok, this is probably a stupid question, but i just can’t get my mind around it for some reason.

What i’m trying to do is to move all the squares. I’ve got a Square movie clip class in my library. The program should populate an amount of squares, unfortunately the amount can vary, which is why i haven’t just gone with

var square1:Square = new Square();  
var square2:Square… etc.

Any help at this point would be much appreciated (\>\_\<)

:stare:

Haze

var thisSquare:Square;  
addEventListener(Event.ENTER\_FRAME, moveLeft, false, 0, true);

for(var i:uint = 0; i\<4; i++)  
{  
thisSquare = new Square();  
thisSquare.name = “square”+i;  
thisSquare.x = 0;  
thisSquare.y = i \*30;  
addChild(thisSquare);  
}

function moveLeft(event:Event):void  
{  
//Move all squares??

```
thisSquare.x += 1; //Only moves the last square.

```

}
