如何从库中添加一个影片剪辑到舞台编程? [英] How to add a MovieClip from the library to the stage programmatically?

查看:232
本文介绍了如何从库中添加一个影片剪辑到舞台编程?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道如何从库中添加一个影片剪辑到舞台上编程。

I am wondering how to add a MovieClip from the library onto the stage programmatically.

我怎么会去这样做?

推荐答案

符号可以定义的动作联动的。

AS连接可以通过右击从库中的元件和选择的属性设置...

AS Linkage may be set by right-clicking a symbol from the library and selecting Properties...

检查的为ActionScript导出的,然后输入一个类名。

Check Export for ActionScript and enter a Class name.

如果您不需要明确定义超越了符号类型的基类,你可以输入链接直接从库:

If you don't need to explicitly define a base class beyond the symbol type, you can enter AS Linkage directly from the Library:

这将创建一个类定义比,如果你写了一个ActionScript类没有什么不同。

This creates a class definition no different than if you had written an ActionScript class.

通过实例化您的AS联动类型的新实例创建实例:

Create instances by instantiating new instances of your AS Linkage type:

var symbolExample:SymbolExample = new SymbolExample();
addChild(symbolExample);

这篇关于如何从库中添加一个影片剪辑到舞台编程?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆