Flash Builder - 如何构建或包含 SWC [英] Flash Builder - How to build or include an SWC

查看:29
本文介绍了Flash Builder - 如何构建或包含 SWC的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在此处重新创建本教程的现代化版本 - 但我在构建和引用 SWC 文件以包含在我的 Flash Builder 项目中时遇到问题.每当我尝试引用 SWC 时,Flash 都会说它不是编译时常量"——谁能帮助我构建 SWC 的过程(主要是命名它以便 Flash Builder 可以引用它)——然后,在 Flash Builder 中,创建对 SWC 的引用?谢谢

I'm trying to recreate a modernized version of this tutorial here - but I'm having problems building and referencing a SWC file for inclusion in my Flash Builder project. Whenever I try to reference the SWC, Flash says it's "not a compile time constant" - can anyone help me with the process of building a SWC (mainly, naming it so that Flash Builder can reference it) - and then, in Flash Builder, creating that reference to the SWC? Thanks

推荐答案

您可以通过创建库项目从 Flash Builder 构建 swc,因为 Emanuil 也已经回答了.通常,位于库项目源路径中的所有类都将在 swc 中结束,然后这些类可用于另一个在其库路径中具有 swc 的项目.

You can build a swc from Flash Builder by creating a Library project as Emanuil also answered already. Normally, all classes that are in the source path of the library project will end up in the swc and those classes are then usable in another project that has the swc in its library path.

另一种创建 swc 的方法是使用 Flash,不仅发布到 swf,还发布到 swc(它是发布设置中的一个复选框).然后,所有已选中Export for ActionScript"和类名的库项目都将在 swc 中结束,以供其他项目使用.

Another way of creating a swc is by using Flash, publishing not only to a swf but to a swc too (it's a checkbox in publish settings). Then all library items that have "Export for ActionScript" checked and a class name, will end up in the swc for use in another project.

您从 swc 引用类与在您自己的源路径中引用类完全相同:

You reference classes from the swc exactly the same as you would reference a class in your own source path:

// this should be the package and class name of the class you need: 
//   not the name of the swc it comes from!
import some.package.name.ClassFromSWC; 

...

new ClassFromSWC();

希望这有帮助...

这篇关于Flash Builder - 如何构建或包含 SWC的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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