如何获取影片剪辑(在另一个影片剪辑内)但相对于 _root 的 X,Y 坐标?
我在另一个影片剪辑中有一个影片剪辑...
//create on the stage an empty movieclip...
var mc_container:MovieClip = _root.createEmptyMovieClip("container_name", _root.getNextHighestDepth());
//new position on the stage...
mc_container._x = 200;
mc_container._y = 200;
//create a movieclip inside the main movieclip...
var mc_inside:MovieClip = mc_container.attachMovie("mc_from_library", "mc_name", mc_container.getNextHighestDepth(), {_x:0, _y:0, _alpha:100});
我可以获取相对于容器影片剪辑的 mc_inside._x 和 mc_inside._y 属性,但是如何获取 mc_inside._x
和 mc_inside._y
相对于 _root
(舞台)?
I have a movieclip inside another movieclip...
//create on the stage an empty movieclip...
var mc_container:MovieClip = _root.createEmptyMovieClip("container_name", _root.getNextHighestDepth());
//new position on the stage...
mc_container._x = 200;
mc_container._y = 200;
//create a movieclip inside the 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 get mc_inside._x and mc_inside._y properties relative to the container movieclip, but how can I get the mc_inside._x
and mc_inside._y
relative to the _root
(the stage)?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用 localToGlobal:
http://help.adobe.com/en_US/ as2/reference/flashlite/WS5b3ccc516d4fbf351e63e3d118ccf9c47f-7d06.html
Use localToGlobal:
http://help.adobe.com/en_US/as2/reference/flashlite/WS5b3ccc516d4fbf351e63e3d118ccf9c47f-7d06.html