Compile css to swfs

CTrain's Avatar


24 Sep, 2014 01:44 PM

My application loads themes as multiple swfs at runtime. Is there a way to compile multiple css files into swfs with GradleFX, some of which live in the same directory?

  1. Support Staff 1 Posted by Yennick Trevels on 24 Sep, 2014 04:56 PM

    Yennick Trevels's Avatar

    There's nothing build-in for this.

    One way to do this would be to create a seperate project for each css theme, with a project type "swf" and framework linking off. But that would probably be overkill.

    Another way would be to create a custom function which will call the mxmlc compiler, and then call that function like:

    compile.doFirst {
         compileThemes(['theme1.css', 'theme2.css'])
    def compileThemes(stylesheets) {
        stylesheets.each { css =>
                    jar: "$project.flexHome/lib/mxmlc.jar",
                    dir: "$project.flexHome/frameworks",
                    fork: true
            ) {
                arg(value: css)
                arg(value: '-output=' + project.file('target').path

    This is completely untested code, but it should be something similar to this.

  2. 2 Posted by CTrain on 24 Sep, 2014 07:26 PM

    CTrain's Avatar

    Thanks for the reply. I did indeed end up taking a similar approach and it's working just fine.

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:


Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts


? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac