开发者

Positiong nested movieclips based on stage

开发者 https://www.devze.com 2023-01-11 00:38 出处:网络
I have multiple nested movieclip in its own different movieclip, and开发者_如何学Go i would like to arrange them accordingly. My idea was to use the localToGlobal function. I can get the position of t

I have multiple nested movieclip in its own different movieclip, and开发者_如何学Go i would like to arrange them accordingly. My idea was to use the localToGlobal function. I can get the position of the MC on stage, but how do I use the function and place the MC based on stage?

cAPos = new Point(objectA.y);
newcAPos = objectA.localToGlobal(cAPos);

cBPos = new Point(objectB.y);
newcBPos = objectB.localToGlobal(cBPos);

objectB.y=objectA.y+objectA.height <-- based on stage


If you want to position nested mc using global coordinates, try globalToLocal() instead.

0

精彩评论

暂无评论...
验证码 换一张
取 消