如何制作一个可以在运行时编译或加载的闪存库?
我正在寻找一个可以在编译时合并到 swf 中或在运行时加载到 swf 中的库。按照我的理解,.swc 文件一般会在编译时合并到 swf 中,而 .swf 文件一般会在运行时加载到 swf 中。有没有一种方法可以让我拥有一个可以同时完成这两项任务的文件?
I'm looking to make a library that can be either merged into a swf at compile time or loaded into a swf at runtime. The way I understand it, .swc files are generally merged into a swf at compile time, and .swf files are generally loaded into a swf at runtime. Is there a way I can have one file that can do both?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以尝试使用authortime共享库。
基本上,您将拥有一个在 MovieClip 中包含共享动画的 FLA。您可以将此剪辑单独构建为 SWF,并将其用于需要在运行时加载它的任何文件。
然后,在需要编译该剪辑的任何其他项目中,您将在该项目中创建一个新的 MovieClip,并将其链接到其他 FLA 中的共享剪辑。
在“符号属性”中,点击“源”部分底部的“浏览”,导航到 FLA,然后导航到共享剪辑。勾选“发布前始终更新”。
现在,如果您对共享剪辑进行更改,您将重新编译加载的 SWF,并重新编译使用该共享资源的任何其他项目。他们应该在构建时自动导入最新版本。
You could try using authortime shared libraries.
Basically you would have an FLA that has the shared animation in a MovieClip. You could build this clip separately as a SWF and use that for any files that need to load it at runtime.
Then, in any other projects that need the clip to be compiled in, you'll create a new MovieClip in that project and link it to the shared clip in the other FLA.
In the Symbol Properties, hit Browse at the bottom in the Source section and navigate to the FLA and then the shared clip. Tick 'Always update before publish'.
Now, if you make changes to shared clip, you'll recompile the SWF that gets loaded, and recompile any of the other projects that use that shared asset. They should automatically import the newest version when they get built.
你想做什么? “图书馆”应该做什么或提供什么?如果它是动画,您可以将其放入 IDE 中并进行编译(而不是在运行时加载)。如果它是代码,那么在运行时加载它是没有意义的。
What are you trying to do? What is the "library" supposed to do or provide? If it's an animation, you can drop it in the IDE and have it compiled in (as opposed to loaded at runtime). If it's code, it's nonsensical to load it at runtime.