flash - how to get X,Y coordinates of a movieclip (inside another movieclip) but relative to the _root? -
i have movieclip inside movieclip...
//create on stage empty movieclip... var mc_container:movieclip = _root.createemptymovieclip("container_name", _root.getnexthighestdepth()); //new position on stage... mc_container._x = 200; mc_container._y = 200; //create movieclip inside main movieclip... var mc_inside:movieclip = mc_container.attachmovie("mc_from_library", "mc_name", mc_container.getnexthighestdepth(), {_x:0, _y:0, _alpha:100});
i can mc_inside._x , mc_inside._y properties relative container movieclip, how can mc_inside._x
, mc_inside._y
relative _root
(the stage)?
use localtoglobal:
var point:object = {x:myclip.inner_mc._x, y:myclip.inner_mc._y}; myclip.inner_mc.localtoglobal(point); trace(point.x) trace(point.y)
http://help.adobe.com/en_us/as2/reference/flashlite/ws5b3ccc516d4fbf351e63e3d118ccf9c47f-7d06.html
Comments
Post a Comment