# For loop and assigning i

**URL:** <https://forum.kirupa.com/t/for-loop-and-assigning-i/229213>\
**Category:** Uncategorized\
**Created:** [June 14, 2007, 9:57pm UTC](https://forum.kirupa.com/t/for-loop-and-assigning-i/229213 "2007-06-14T21:57:24Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![sean1983uk](https://avatars.discourse-cdn.com/v4/letter/s/ccd318/32.png) [@sean1983uk](https://forum.kirupa.com/u/sean1983uk)\
**Post date:** [June 14, 2007, 9:57pm UTC](https://forum.kirupa.com/t/for-loop-and-assigning-i/229213/1 "2007-06-14T21:57:24Z")

</div>

i’m trying to use a for loop to create 219 movie clips and have it assign the value i to each one.

this is how the movie clips are named on the stage

rollover1\_mc, rollover2\_mc, rollover3\_mc and so on.

heres the for loop i was trying:

```auto

for(i=0; i<220; i++){
rollover + i + _mc.onRollOver = displayContent;
}

```

doesn’t seem to be working.

basically i need it to repeat so i creates the following lines of code:

rollover1\_mc.onRollOver = displayContent;  
rollover2\_mc.onRollOver = displayContent;  
rollover3\_mc.onRollOver = displayContent;

etc, etc

Any pointers?
