# Array of movie clip widths

**URL:** https://forum.kirupa.com/t/array-of-movie-clip-widths/245086
**Category:** flash
**Created:** [November 26, 2007, 10:25am UTC](https://forum.kirupa.com/t/array-of-movie-clip-widths/245086 "2007-11-26T10:25:42Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![nikneven](https://avatars.discourse-cdn.com/v4/letter/n/41988e/32.png) [@nikneven](https://forum.kirupa.com/u/nikneven)
#### Post date: [November 26, 2007, 10:25am UTC](https://forum.kirupa.com/t/array-of-movie-clip-widths/245086/1 "2007-11-26T10:25:42Z")

</div>

Ok, I swear that arrays and loops will be the death of me, and I still cant find any “Jeez you are stupid so I’ll spell it out slowly and COMPLETELY for you” tutorials.

I have 5 movie clips, currently. and I am positioning them via actionscript. The instance names are nar, mv, dance, bio, clients, contact. (pretty obvious this is navigation for a portfolio site, huh?)

here is the positioning i currently have…

```auto

var spacing = (((Stage.width*.75) - (nar._width + mv._width + dance._width + bio._width + clients._width + contact._width))/5);
    nar._x = 10;
    mv._x = 10+nar._width+spacing;
    dance._x = 10+nar._width+mv._width+(spacing*2);
    bio._x = 10+nar._width+mv._width+dance._width+(spacing*3);
    clients._x = 10+nar._width+mv._width+dance._width+bio._width+(spacing*4);
    contact._x = 10 + nar._width + mv._width + dance._width + bio._width + clients._width + (spacing*5);

```

Now, I know that this can be done with an array and a loop, something like, loop through all movie clips for width, then use the total in the spacing variable, then for each clip in the array, set the \_x to 10 + the width of the clips before it + spacing times its array position, but man, I can just NOT figure out the syntax.

Any help would be greatly appreciated.

~nik
