# Dynamic MC's This Way?

**URL:** <https://forum.kirupa.com/t/dynamic-mcs-this-way/320124>\
**Category:** flash\
**Created:** [March 14, 2011, 10:59pm UTC](https://forum.kirupa.com/t/dynamic-mcs-this-way/320124 "2011-03-14T22:59:35Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![megshea](https://avatars.discourse-cdn.com/v4/letter/m/e36b37/32.png) [@megshea](https://forum.kirupa.com/u/megshea)\
**Post date:** [March 14, 2011, 10:59pm UTC](https://forum.kirupa.com/t/dynamic-mcs-this-way/320124/1 "2011-03-14T22:59:35Z")

</div>

Hey Gang, I’m trying to make some dynamic movie clips, with a drawn rectangle inside a for loop. But I can’t figure out if an MC can be named like an Array. How close is this?

```auto

function init(e:Event = null):void
{
    removeEventListener(Event.ADDED_TO_STAGE, init);

    var guideBox:Array;

    
    for (var i:int = 1; i < 10; i++)
    {
        var nextXPos = i*(boxWidth+boxMargin);

        guideBox* = new MovieClip();
        guideBox*.graphics.beginFill(0xff1111);
        guideBox*.graphics.drawRect(nextXPos, 0, boxWidth, boxHeight+boxMargin);
        guideBox*.addEventListener(MouseEvent.CLICK, doButton);

        addChild(guideBox*);
        

    }

```
