PDA

View Full Version : attach movie clip at a specific stage location


yogidishman
08-05-2009, 08:45 PM
I am trying to attach a movie clip at a specific location on the stage using the following code:


attachMovie("plane_mc", "mc", 1, {x:50} );

The statement above does attach my MC called plane_mc onto the stage but it won't attach it at the location where I want it to. The x parameter doesn't seem to have any effect whatsovever on the stage location. Can someone please help.

Thank you.

Note that I am using Flash 8 AS 3.

rholdrae
08-06-2009, 03:11 AM
try this...


plane_mc = attachMovie("plane_mc", "mc", 1);
plane_mc._x = 50;

asf8
08-06-2009, 03:59 AM
Note that I am using Flash 8 AS 3.

Flash 8 only supports AS1 and AS2, you cant use AS3 in Flash 8. Thus using x (as in AS3) wont work, you need to use _x (which is AS2).

attachMovie("plane_mc", "mc", 1, {x:50} );

The x parameter doesn't seem to have any effect whatsovever on the stage location. Can someone please help.

var planeMC:MovieClip = this.attachMovie("plane_mc", "planeMC", this.getNextHighestDepth(), {_x:50, _y:150});

Hope it helps. Or you can also do it as rholdrae noted above.