使用 SWC 资产时需要额外的包装器或装饰器类吗?
我仍在学习如何使用 Flex SDK 进行编译。我正在学习如何使用 SWC 文件和 [EMBED]
语句将我的资产提取到我的应用程序中。
使用 Flash IDE,我可以将库资源链接到类,并且它会自动嵌入到我的自定义类中。所以这是 1 类中的 1 项资产。使用 Flex SDK 和 SWC 文件,我似乎只能*在变量级别提取资源,因此我最终得到了包含另一个类的自定义类 - 这意味着我有一个额外的包装器/decorator(无论你想怎么称呼它)类,我在使用 Flash IDE 时没有。
这是人们通常做的事情吗?这不显得多余吗?
- 我读过 Colin Moock 的“Essential Actionscript 3.0”,其中他提到了有关在类级别将 SWF 作为二进制数据嵌入的内容...WTF。
I'm still learning how to compile with the Flex SDK. And I'm learning how to use SWC files and [EMBED]
statements to pull my assets into my application.
With the Flash IDE, I can link a library asset to a class and it's automatically embedded into my custom class. So that's 1 asset in 1 class. With the Flex SDK and SWC files, it seems I can only* pull in assets at the variable level, so I end up with my custom classes containing yet another class -- this means I have an extra wrapper/decorator (whatever you want to call it) class that I didn't have when using the Flash IDE.
Is this what people typically do? Doesn't that seem superfluous?
- I've read Colin Moock's 'Essential Actionscript 3.0', where he mentions something about embedding a SWF at class-level as binary data... WTF.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
要将符号直接关联到类,请执行以下操作。这也适用于所有类型的子类(只要它们扩展了适当的基类):
To associate a symbol directly to a class do like this. This works for all kinds of subclasses aswell (as long as they extend the appropriate base class):
与 Flash 库资源关联的类必须包含在同一 SWC 中。
?
那么,当Flash编译SWC时,它会找到关联的类并将它们绑定在一起吗?
如果是这样的话,那么艺术作品和代码会在同一个 SWC 文件中耦合在一起吗?我认为 Flex w/ SWC 很棒,因为艺术作品解耦...?
编辑:这不起作用。我实例化 SWC 资产的唯一方法是它继承自基类,所以看来我无法将自定义类与 SWC 资产关联起来??????!!!!!!< /em>
A class associated with a Flash library asset must be contained within the same SWC.
?
Then, when the SWC is compiled by Flash, it finds the associated class and binds them together?
If this is the case, then artwork and code is coupled together in the same SWC file? I thought Flex w/ SWCs was great because artwork was decoupled...?
EDIT: This is not working. The only way I can instantiate a SWC asset is if it inherits from the base class, so it seems I can't associate custom classes with SWC assets?????!!!!!!