# Any ideas why this doesn't work?

**URL:** <https://forum.kirupa.com/t/any-ideas-why-this-doesnt-work/210698>\
**Category:** flash\
**Created:** [December 21, 2006, 4:11am UTC](https://forum.kirupa.com/t/any-ideas-why-this-doesnt-work/210698 "2006-12-21T04:11:21Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![skellykitten](https://avatars.discourse-cdn.com/v4/letter/s/7ea924/32.png) [@skellykitten](https://forum.kirupa.com/u/skellykitten)\
**Post date:** [December 21, 2006, 4:11am UTC](https://forum.kirupa.com/t/any-ideas-why-this-doesnt-work/210698/1 "2006-12-21T04:11:21Z")

</div>

ActionScript Code:  
[FONT=Courier New][LEFT][COLOR=#000000] **var** [/COLOR] m1\_depth:[COLOR=#0000FF]Number[/COLOR] = [COLOR=#000080]1018571[/COLOR];

[COLOR=#000000] **function** [/COLOR] attach\_mb[COLOR=#000000]([/COLOR]mc\_name, mc\_inst, xPos, yPos, zdepth[COLOR=#000000])[/COLOR][COLOR=#000000]{[/COLOR]  
thisRoot.[COLOR=#0000FF]attachMovie[/COLOR][COLOR=#000000]([/COLOR]mc\_name, mc\_inst, zdepth[COLOR=#000000])[/COLOR];  
mc\_inst.[COLOR=#0000FF]\_x[/COLOR] = xPos;  
mc\_inst.[COLOR=#0000FF]\_y[/COLOR] = yPos;

wind1.[COLOR=#000080]bt[/COLOR].[COLOR=#0000FF]onPress[/COLOR] = [COLOR=#000000] **function** [/COLOR]COLOR=#000000[/COLOR][COLOR=#000000]{[/COLOR]  
attach\_mb[COLOR=#000000]([/COLOR][COLOR=#FF0000]“past\_btn”[/COLOR], [COLOR=#FF0000]“past1\_btn”[/COLOR], [COLOR=#000080]167[/COLOR], [COLOR=#000080]257[/COLOR], m1\_depth[COLOR=#000000])[/COLOR];

[COLOR=#000000]}[/COLOR]  
[/LEFT]  
[/FONT]

It’s attaching the mc, and it seems as though the depth var is working, but ithe x y coordinates are not. They are gettig placed at 0 x and 0y.  
can anyone help? If I can get that to work right I can cut my script in half I think:)  
Thank you!
