Flex 图形资源:SWF 还是 SWC?
SWF 或 SWC 哪种格式更好地存储 Flex 应用程序的图形资源?
是否存在任何真正的差异?如果有,差异是什么?
Which is a better format to store graphic assets for a Flex application, SWF or SWC?
Are there any real differences, and if so what are they?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
单独 SWF 中的资源在运行时加载并包含。
SWC 中的资源在编译时加载并包含/编译。
您还可以在编译时直接将资源嵌入到主应用程序 SWF 中(查看嵌入元数据)。
当然,您也可以在运行时直接加载单个资源(例如 PNG)。
至于哪个更好,这实际上取决于您想要做什么以及如何使用资产。
麦克风
Assets in a seperate SWF are loaded and included at runtime.
Assets in a SWC are loaded and included / compiled at compile time.
You can also directly embed assets within the main app SWF at compile time (check out the Embed meta data).
Of course, you can also load individual assets (such as a PNG) directly at runtime.
As far as which is better, it really depends on what you are trying to do, and how the assets are used.
mike
当您寻找要编译到应用程序中的库时,您可以使用 SWC。 您可以访问这些类并可以导入各个部分。 SWF 更有可能是您在嵌入图形时需要的文件。
以下是您可能感兴趣的文档:
http ://livedocs.adobe.com/flex/3/html/help.html?content=layoutperformance_06.html#223998
我在使用 SVG 处理图像方面取得了很好的成功,但有一些警告,因为 Flex 只实现了特征的子集。
SWC is what you use when you're looking for a library to compile into your app. You have access to the classes and can import individual parts. SWF is more likely what you're looking for when embedding graphics.
Here's the docs you might be interested in:
http://livedocs.adobe.com/flex/3/html/help.html?content=layoutperformance_06.html#223998
I've been having good success with SVG for images, but there's some caveats since Flex only implements a subset of the features.
我没有真正的理由这样做,所以它可能是不正确的,但我通常为运行时需要加载的东西创建 SWF,为设计时需要可用的东西创建 SWC。
I have no real reason for doing this so it may be incorrect but I usually create SWF's for things that need to be loaded during runtime and SWC's for things that need to be available for design time.
SWC 只是一个 SWF 和一些封装在 zip 文件中的元数据。 除了不支持 SWC 的运行时加载这一事实之外,我认为使用这两种格式之间没有任何重大差异。
A SWC is simply a SWF and some metadata wrapped into a zip file. Other than the fact that runtime loading of SWC isn't supported, I don't think there are any major differences between using the two formats.