访问脚本上的影片剪辑? (AS2)
我习惯于使用 AS3,但由于最近发生的事件,我需要使用 AS2,并且我在完成一项简单任务时遇到了麻烦:
如何访问 AS 中的 MovieClip? 我画了将其转换为符号(MovieClip 类型)并勾选“导出为 ActionScript”。我给它起了个名字“MyMC”。现在,当我进行其他 MovieClip 操作时,如何访问我之前在舞台上绘制的 MovieClip?
I'm used to working with AS3, but due to recent events I need to work with AS2, and I'm having trouble with a simple task:
How do I access a MovieClip in AS? I drew something, converted it to a symbol (of type MovieClip) and ticked "Export for ActionScript". I gave it the name "MyMC". now, when I'm in some other MovieClips action, how do I access the MovieClip I drew on stage before?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果它是舞台上的一个对象,您需要使用属性面板为其指定一个实例名称,然后您可以通过
_root
属性访问它:标识符的使用:
告诉库符号导出为动作脚本,其工作方式与在 AS3 中类似。您分配的导出名称是用于使用
attachMovie
函数创建该元件实例的名称:attachMovie
接受 3 个参数:name
属性。这是您为创建的符号的每个实例分配的唯一名称。getNextHighestDepth
将其放置在最高可用深度,与在 AS3 中使用addChild
相同。If it's an object on the stage you need to give it an instance name using the properties panel, and then you can access it through the
_root
property:Use of Identifier:
Telling a library symbol to export for actionscript works in a similar way to in AS3. The export name you assign is a name that you use to create an instance of that symbol, using the
attachMovie
function:attachMovie
accepts 3 parameters:name
property of a DisplayObject in AS3. It is a unique name that you assign to each instance of the symbol you create.getNextHighestDepth
to place it in the highest available depth, same as usingaddChild
in AS3.