I have a flex project tha开发者_开发知识库t uses bunch of images. When I build my project, it creates main.swf and images folder separately.
I would like to compile one swf file which should contain all images. I dont know how to accomplish this.
Here is my dir structure:
Main
-src (dir)
--com.main (different packages)
--images (contains images)
Thanks
You'll have to embed the images in the SWF. More info here.
Conceptually something like this:
[Embed(source="images/logo.gif")]
[Bindable]
public var imgCls:Class;
In your MXML, do something like this to access it:
<mx:Image id="myImageRaw" source="{imgCls}"/>
However, your compile process should not--I believe--create an images folder. I suspect you are using Flash Builder; which has an option to move "other files" into the bin-debug folder. You should be able to change this in the project properties. Bring up the Flex Compiler property page and deselect "copy non-embedded files to output folder".
精彩评论