@João - Thanks! I downloaded the 'Flex 3 Compiler Module for ColdFusion 8' 
2.6Beta from here 
http://labs.adobe.com/downloads/livecycle_dataservices2_6.html and installing 
this allowed me to build a SWF.

@Cameron - Yes using the variable 'application' was a bad idea, I was so 
focussed on duplicating the example I blanked out on that. It had no affect on 
the code running correctly.


Here's some slightly more detailed code that will display any compile errors:

<cfscript>
        //set mxml file name
        input = expandPath('Test2.mxml');
        output = expandPath('Test.swf');
        //read file
        mxmlFile = createObject("Java","java.io.File").Init(input);
        //create flex sdk
        app = createObject("Java","flex2.tools.oem.Application").init(mxmlFile);
        //create output swf file
        swf = createObject("Java","java.io.File").Init(output);
        //set output swf
        app.setOutput(swf);
        //get config
        config = app.getDefaultConfiguration();
        // Enable ActionScript optimizer.
        config.optimize(true);
        // Replace this with a valid license key.
        config.setLicense("flexbuilder3", "0000-0000-0000-0000-0000-0000");
        // Disable warnings.
        config.showActionScriptWarnings(false);
        config.showBindingWarnings(false);
        config.showUnusedTypeSelectorWarnings(false);
        config.keepConfigurationReport(false);
        // Apply the new configuration to the Application.
        app.setConfiguration(config);
        //build SWF
        result = app.build(JavaCast("Boolean",true));
        //create report
        report = app.getReport();
        messages = report.getMessages();
</cfscript>
<!--- did it build? --->
<h1>Success: <span style="color:red;"><cfdump 
var="#yesnoformat(result)#"></span></h1>
<!--- output errors if we got them --->
<cfif isdefined('messages') and isArray(messages) and arrayLen(messages) GT 0>
        <cfoutput>
    <cfloop from="1" to="#arrayLen(messages)#" index="i">
        #messages[1].getLevel()# :: 
        #messages[1].getPath()# :: 
        #messages[1].getColumn()# :: 
        #messages[1].toString()# ::
    </cfloop>
    </cfoutput>
</cfif>

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;192386516;25150098;k

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:304316
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to