# Dupicating Movieclip & positioning them?

**URL:** https://forum.kirupa.com/t/dupicating-movieclip-positioning-them/35362
**Category:** Uncategorized
**Created:** [November 13, 2003, 2:57am UTC](https://forum.kirupa.com/t/dupicating-movieclip-positioning-them/35362 "2003-11-13T02:57:24Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Whydoyouwork](https://avatars.discourse-cdn.com/v4/letter/w/6a8cbe/32.png) [@Whydoyouwork](https://forum.kirupa.com/u/Whydoyouwork)
#### Post date: [November 13, 2003, 2:57am UTC](https://forum.kirupa.com/t/dupicating-movieclip-positioning-them/35362/1 "2003-11-13T02:57:24Z")

</div>

What I’m trying to do, is duplicate a movie clip an x amount of times, based on a variable loaded externally, not the problem though, got that working fine.

My problem comes in while I’m trying to reposition the duplicated movies, to line up in a stacked order.

It duplicates the movie the number of times I need it, but when trying to call upon the movie clip, which is the a=this[“a”+i]; script, nothing happens, the clips don’t get repositioned.

If anyone can help me out, it’d be much apreciated.

Heres the code;  
onClipEvent (load) {  
x = 0;  
y = 1;  
space = 1;  
num = 21;  
stat = 1;  
var Work = new LoadVars();  
Work.load(“portfolio.txt”, this.Work);  
Work.onLoad = function(loaded) {  
if (loaded) {  
\_parent.t = "PHP loaded just fine\<br\>results = "+Work.num\_results;  
for (i=2; (i-1)\<=Work.num\_results; i++) {  
a1.duplicateMovieClip(“a”+i, i);  
a = this[“a”+i];  
// Math to space out icons  
if (x\<10) {  
x++;  
} else {  
y++;  
x = 1;  
}  
a.\_y = a1.\_y+a1.\_height_y;  
a.\_x = a1.\_x+a1.\_width_x;  
a.\_visible = true;  
a.ty = Work.TYPE[i-2];  
a.ti = Work.TITLE[i-2];  
a.id = Work.ID[i-2];  
}  
}  
};  
}

Heres the open source;  
[http://www.whydoyouwork.com/recentf...ork\_Dynamic.zip](http://www.whydoyouwork.com/recentf...ork_Dynamic.zip)

[edited at 11.55am central time by whydoyouwork]

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [November 13, 2003, 4:46pm UTC](https://forum.kirupa.com/t/dupicating-movieclip-positioning-them/35362/2 "2003-11-13T16:46:05Z")

</div>

It’s hard to help if you don’t tell us what’s happening :-  
Anyway, you can have a look at the grid tutorial, it might help 🙂
