# Simple array assignment?

**URL:** https://forum.kirupa.com/t/simple-array-assignment/290965
**Category:** flash
**Created:** [June 22, 2009, 9:11pm UTC](https://forum.kirupa.com/t/simple-array-assignment/290965 "2009-06-22T21:11:48Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![marcelomdsc](https://avatars.discourse-cdn.com/v4/letter/m/aca169/32.png) [@marcelomdsc](https://forum.kirupa.com/u/marcelomdsc)
#### Post date: [June 22, 2009, 9:11pm UTC](https://forum.kirupa.com/t/simple-array-assignment/290965/1 "2009-06-22T21:11:48Z")

</div>

Hello Ive create an array that holds 80 instance names for 80 movieClips.  
Dot1, Dot2, Dot3,…Dot80, with the following code…

```auto

var Dots = new Array();
Dots[0] = null;
for(i=1; i<=80; i++) {
  Dots* = "Dot" + i;
} 

```

And its working just fine. I tested it with trace statements.

But now I need to tell each of those instances that onRelease they  
should go to \_root.Background.gotoAndStop(x);

So I wrote the following code right after creating the array…

```auto

for(e=1; e<=80; e++) {
    Dot[e].onRelease = function(){
    _root.Background.gotoAndStop(e);
    };
}
 

```

But its not working, it doesnt even look like it should work, but Im just  
learning and cant seem to find how to do it around the net.

Any help with be much appreciated.  
Marcelo.
