如何在不创建新实例的情况下从文档类操作舞台上的符号
所以我在舞台 rect_mc 上有一个影片剪辑和文档类 Main.as ... 我可以将影片剪辑导入到文档类
import rect_mc;
并创建一个新实例
public var rect:rect_mc = new rect_mc();
addChild(rect);
,但是有什么方法可以操作 rect_mc 而无需创建新实例并将其附加到使用 addChild() 的舞台
So I have one movie clip on stage rect_mc and document class Main.as ...
I can import movie clip to document class with
import rect_mc;
and create a new instance
public var rect:rect_mc = new rect_mc();
addChild(rect);
but is there any way to manipulate rect_mc without craating new instance and attaching it to a stage with addChild()
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我注意到你的问题是什么。如果舞台上有 MovieClip,您可以通过其实例名称访问它。您不需要创建新实例。
如果您不打算再实例化 MovieClip 的任何实例,则可以删除 MovieClip 的链接和导出属性。
I am note sure what your question is. If you have the MovieClip on stage you can access it by its instance name. You dont need to create a new instance.
If you are not going to instantiate any more instances of the MovieClip then you can get rid of the linkage and export properties for the MovieClip.
如果不创建 rect_mc 的实例,您就无法对其进行操作,但实际上您不必在执行任何操作之前将其添加到舞台上。您仍然可以定位/缩放/旋转/任何其他操作,只是您看不到它
You can't manipulate
rect_mc
without creating an instance of it, but you don't actually have to add it to the stage before you do anything. You can still position/scale/rotate/whatever, you just won't see it