# Looping through assignments

**URL:** <https://forum.kirupa.com/t/looping-through-assignments/266412>\
**Category:** flash\
**Created:** [July 20, 2008, 12:17am UTC](https://forum.kirupa.com/t/looping-through-assignments/266412 "2008-07-20T00:17:43Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pherank](https://avatars.discourse-cdn.com/v4/letter/p/4af34b/32.png) [@Pherank](https://forum.kirupa.com/u/Pherank)\
**Post date:** [July 20, 2008, 12:17am UTC](https://forum.kirupa.com/t/looping-through-assignments/266412/1 "2008-07-20T00:17:43Z")

</div>

I’m brain dead today - I can’t remember the syntax to create a loop assignment to simplify the code below:

```auto

item1_mc.onRelease = function() {
    pageText_mc.pageText_tb.htmlText = contentArr[0];
    easeContent();
};
item2_mc.onRelease = function() {
    pageText_mc.pageText_tb.htmlText = contentArr[1];
    easeContent();
};
item3_mc.onRelease = function() {
    pageText_mc.pageText_tb.htmlText = contentArr[3];
    easeContent();
};

```

(etc.)

What’s the best way to deal with incrementing through the movie clips - “item\*\_mc” in this context?
