# Assigning x,y positions to dynamically attached clips question

**URL:** <https://forum.kirupa.com/t/assigning-x-y-positions-to-dynamically-attached-clips-question/264739>\
**Category:** flash\
**Created:** [June 29, 2008, 10:05pm UTC](https://forum.kirupa.com/t/assigning-x-y-positions-to-dynamically-attached-clips-question/264739 "2008-06-29T22:05:35Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![wolcotter](https://avatars.discourse-cdn.com/v4/letter/w/6bbea6/32.png) [@wolcotter](https://forum.kirupa.com/u/wolcotter)\
**Post date:** [June 29, 2008, 10:05pm UTC](https://forum.kirupa.com/t/assigning-x-y-positions-to-dynamically-attached-clips-question/264739/1 "2008-06-29T22:05:35Z")

</div>

As you can see I am attempting to assign x,y positions to clips that are being “attached.” I would be greatly appreciative if someone could tell me what am I doing wrong here. TIA.

var clipArray = new Array();  
clipArray = [189, 275, 361]; // x positions

for (var i:Number = 1; i \< 4; i++) {  
this.attachMovie(“clip”+i,“butt\_”+i,i,{\_x: [clipArray(i-1)], \_y: 142});  
}

---

<div class="post-metadata">

**Author:** ![creatify](https://avatars.discourse-cdn.com/v4/letter/c/d07c76/32.png) [@creatify](https://forum.kirupa.com/u/creatify)\
**Post date:** [June 29, 2008, 10:17pm UTC](https://forum.kirupa.com/t/assigning-x-y-positions-to-dynamically-attached-clips-question/264739/2 "2008-06-29T22:17:52Z")

</div>

[QUOTE=wolcotter;2351052]As you can see I am attempting to assign x,y positions to clips that are being “attached.” I would be greatly appreciative if someone could tell me what am I doing wrong here. TIA.

var clipArray = new Array();  
clipArray = [189, 275, 361]; // x positions

for (var i:Number = 1; i \< 4; i++) {  
this.attachMovie(“clip”+i,“butt\_”+i,i,{\_x: [clipArray(i-1)], \_y: 142});  
}[/QUOTE]

try:  
\_x:clipArray[i-1]

---

<div class="post-metadata">

**Author:** ![wolcotter](https://avatars.discourse-cdn.com/v4/letter/w/6bbea6/32.png) [@wolcotter](https://forum.kirupa.com/u/wolcotter)\
**Post date:** [June 30, 2008, 2:25am UTC](https://forum.kirupa.com/t/assigning-x-y-positions-to-dynamically-attached-clips-question/264739/3 "2008-06-30T02:25:10Z")

</div>

Thanks for the reply creatify. Unfortunately it didn’t work for me. Maybe I could get you to have a look? (See attached file). Again, I appreciate the help more than you know.

---

<div class="post-metadata">

**Author:** ![wolcotter](https://avatars.discourse-cdn.com/v4/letter/w/6bbea6/32.png) [@wolcotter](https://forum.kirupa.com/u/wolcotter)\
**Post date:** [June 30, 2008, 2:30am UTC](https://forum.kirupa.com/t/assigning-x-y-positions-to-dynamically-attached-clips-question/264739/4 "2008-06-30T02:30:29Z")

</div>

By the way, here is the edited version that isn’t working for me…

var clipArray = new Array();  
clipArray = [189, 275, 361];

for (var i:Number = 1; i \< 4; i++) {  
this.attachMovie(“clip”+i,“clip\_”+i,i,{\_x:clipArray[i-1], \_y:142});  
}

for (var i:Number = 1; i \< 4; i++) {  
this.attachMovie(“btn”+i,“btn\_”+i,i,{\_x:clipArray[i-1], \_y:289});  
}

---

<div class="post-metadata">

**Author:** ![wolcotter](https://avatars.discourse-cdn.com/v4/letter/w/6bbea6/32.png) [@wolcotter](https://forum.kirupa.com/u/wolcotter)\
**Post date:** [June 30, 2008, 4:07am UTC](https://forum.kirupa.com/t/assigning-x-y-positions-to-dynamically-attached-clips-question/264739/5 "2008-06-30T04:07:30Z")

</div>

Figured it out. Again, thanks for the help.
