# Create multiple movie instances with AS?

**URL:** <https://forum.kirupa.com/t/create-multiple-movie-instances-with-as/179340>\
**Category:** Uncategorized\
**Created:** [February 19, 2006, 3:09am UTC](https://forum.kirupa.com/t/create-multiple-movie-instances-with-as/179340 "2006-02-19T03:09:21Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mathminded](https://avatars.discourse-cdn.com/v4/letter/m/bb73d2/32.png) [@mathminded](https://forum.kirupa.com/u/mathminded)\
**Post date:** [February 19, 2006, 3:09am UTC](https://forum.kirupa.com/t/create-multiple-movie-instances-with-as/179340/1 "2006-02-19T03:09:21Z")

</div>

I’m running into a roadblock with creating multiple instances of a movie clip. I’m trying to display a series of boxes across the bottom of the stage. The number of boxes are determined by \_global.maxStep[\_global.sectionNum]. I have a movie clip called StepBox that will serve as the template for each box. In the StepBox movie clip is a dynamic text box called stepNumText, which I want to set to the value of the counter. The problem I have is that I’ve only ever used attachMovie, but there is no movie for it to attach to. I tried using Content since that’s the name of the layer this is in, but I know that doesn’t make sense (and it doesn’t work).  
[FONT=Courier New]

```auto
_global.updateBoxes = function() {
 var curr_box;
 for (i = 1; i <= _global.maxStep[_global.sectionNum]; i++) {
  curr_box = Content.attachMovie("StepBox", "StepBox"+i+"_mc", i);
  curr_box._x = 30 + 20*i;
  curr_box._y = 375;
  curr_box.stepNumText.text = String(i);
 }
};

```

[/FONT]  
Any help for this newbie would be greatly appreciated!

Thanks!

Mathminded
