开发者

Flex how to compile images into swf

开发者 https://www.devze.com 2023-03-10 00:52 出处:网络
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 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".

0

精彩评论

暂无评论...
验证码 换一张
取 消