通过运行时共享库混合 Flash 和 Flex 编译的 ActionScript 代码
我们两个人正在开发 Flash 应用程序。
我正在处理一些 ActionScript 3 代码, 我在 Linux 上使用 Flex SDK 将其编译为 .swc
文件。 我的同事在 Flash IDE 中将该文件用作他的 .fla
文件的库, 在他的脚本中使用我的代码,创建 MovieClip 和 Sound 对象 与它提供的类, 并从那里构建最终的
我们希望将 Flex 编译的代码链接为运行时共享库, 这样我就可以替换我的课程的新版本并查看结果 无需通过 Flash IDE。
我们想要实现的目标可能吗? 如果是这样,知道我们可能做错了什么吗? (见下文)
我们使用 Flex SDK 版本 3.4.0.9271 和 Flash CS4 10.0.2。
使用 .swc
作为静态库效果很好。 然而,一旦我们移动它 从“库路径”选项卡 到“外部库路径”选项卡 在“ActionScript 3.0高级设置”中, 小程序停止工作。 我们还尝试为 .swc
文件指定 URL 在“库”窗口的“共享库属性”中, 没有效果。
(请原谅回译的菜单名称, 请随时纠正我。)
ActionScript 代码是使用以下命令行编译的 (还有其他三个包中的课程):
acompc -output=engine.swc -compiler.source-path=.
-include-classes=lib.room.TransientLoc,lib.room.State,...
感谢您提前提出的任何建议,
we are two people working on a Flash application.
I work on some ActionScript 3 code,
which I compile to a .swc
file using the Flex SDK on Linux.
My colleague uses the file as a library for his .fla
file in the Flash IDE,
uses my code in his scripts, creates MovieClip and Sound objects
with the classes it provides,
and builds the final .swf
file from there,
with everything linked in.
We would like to link the flex-compiled code as a runtime shared library,
so I can substitute a new version of my classes and see the result
without going through the Flash IDE.
Is what we're trying to achieve possible?
If so, any idea what we might be doing wrong?
(see below)
We use the Flex SDK version 3.4.0.9271 and Flash CS4 10.0.2.
Using the .swc
as a static library works fine.
However, as soon as we move it
from the "Library path" tab
to the "External library path" tab
in the "ActionScript 3.0 advanced settings",
the applet stops working.
We have also tried to specify a URL for the .swc
file
in the "Shared library properties" from the "Library" window,
with no effect.
(Please forgive the back-translated menu names,
feel free to correct me.)
The ActionScript code is compiled with the following command-line
(there are classes from three other packages):
acompc -output=engine.swc -compiler.source-path=.
-include-classes=lib.room.TransientLoc,lib.room.State,...
Thanks for any suggestion in advance,
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Flash CS4 IDE 支持 RSL 吗?我认为这是一种仅在 Flex 中可用的机制。
您可能希望将 Flex Builder 代码编译为 swf,并在应用程序中执行任何其他操作之前将该 swf 导入到 CS4 代码中。这样,您的类在运行时可用,但您可以导入新的 swf,而无需重新编译 Flash IDE 内容。
Does Flash CS4 IDE support RSL? I thought it was a mechanism that was only available in Flex.
You may want to compile your Flex Builder code into a swf, and import the swf into the CS4 code before you do anything else in the application. This way your classes are available at runtime but you can import a new swf without recompiling the Flash IDE stuff.
请注意,external-library-path 仅告诉链接器外部化该 SWC 中找到的所有符号,它实际上并没有告诉它 RSL 在哪里。您说您提供了 SWC 的 URL,但这还不够;您需要提取 SWC 内的 SWF 才能使用它。这些都是 mxmlc/Flex Builder 在幕后为您处理的所有内容,但由于您使用 Flash 进行链接,因此您需要手动执行一些操作。
Note that external-library-path only tells the linker to externalize all symbols found in that SWC, it doesn't actually tell it where the RSL is. You said that you provided a URL for the SWC, which isn't enough; you need to extract out the SWF that is inside the SWC in order to use it. This is all stuff that mxmlc/Flex Builder handles for you behind the scenes, but since you're linking using Flash, you'll need to do a few things manually.