Compile css to swfs

CTrain's Avatar

CTrain

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 =>
            ant.java(
                    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

Generic

? 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

Recent Discussions

24 Mar, 2017 07:10 PM
19 Mar, 2017 04:39 AM
22 Jan, 2017 07:46 AM
11 Oct, 2016 01:18 PM
20 Sep, 2016 04:36 PM

 

06 Sep, 2016 08:05 PM
03 Aug, 2016 11:15 AM
01 Jun, 2016 05:20 PM
03 May, 2016 09:17 PM
07 Apr, 2016 07:43 AM
24 Mar, 2016 05:55 PM