Search code examples
cssapache-flexflex4command-promptflex4.10

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


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.


Solution

  • 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...