Flex graphic assets: SWF or SWC?

橙三吉。 提交于 2019-12-29 23:27:50

问题


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?


回答1:


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




回答2:


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.




回答3:


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.




回答4:


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.



来源:https://stackoverflow.com/questions/164162/flex-graphic-assets-swf-or-swc

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!