How to convert 2 css files into one swf file in flex 4.11 SDK

327 Views Asked by At

I am having 2 different CSS files in my application but i need to use one swf file by combining those two CSS styles.

Can anyone give me some idea to compile two css files in command prompt.

Usually we do compile single css file by using like

"SDK-path/mxmlc -locale= 'target-file' -output='output-filename.swf'"

I tried by using those 2 css files as target files seperated by comma(,) but it is not working. "SDK-path/mxmlc -locale= 'target-file-1,target-file-2' -output='output-filename.swf'"

How to compile 2 CSS files like this in command prompt. Thanks in advance.

2

There are 2 best solutions below

0
On BEST ANSWER

Since mxmlc compiles only one css to swf at a time, we can merge or append multiple css files to single file and then compile that output css file to swf.

In command prompt

type file_1.css >> output.css
type file_2.css >> output.css
%FLEX_SDK_PATH%/mxmlc output.css -o output.swf

If you don't want the output.css simple delete the css using delete command

del output.css

the above commands will append the two css files and then compile that to single swf, if you thought to merge the css files (this in case of using same className/styleName for overriding file_1.css with file_2.css so that file_2.css will take the precedence) use the following command

copy file_1.css+file_2.css output.css
%FLEX_SDK_PATH%/mxmlc output.css -o output.swf
del output.css

hope this might help you...

1
On

This is not possible, but I guess if 1 file needs/uses/imports the other file it should also be compiled into the Shockwafe Flash.

Try adding this: @import("/path-to-your-styles.css"); to one of the CSS files.


DISCLAIMER: I have not tried this yet.