Question

From Adobe's documentation:

To set the value of these constants in the flex-config.xml file, rather than on the command line, you write this as the following example shows:

<compiler> 
    <define append="true"> 
        <name>CONFIG::debugging</name> 
        <value>true</value> 
    </define> 
    <define append="true"> 
        <name>CONFIG::release</name> 
        <value>false</value> 
    </define> 
</compiler>

The problem is that compiler doesn't actually take them into account and giving me compilation errors like "Error: Access of undefined property debugging." since I have that in my ActionScript code.

If I define them via arguments ("-define+=CONFIG::debugging,true") everything is OK.

I thought maybe my config is not used at all, so I malformed it — mxmlc points that out. So config is actually loaded into compiler.

Any hints? Thank you.

Was it helpful?

Solution 2

So it was the XML problem — as I actually had strings, not booleans, in config — you should not forget to write the proper XML (weird that compiler didn't say me back anything).

<value>&quot;MyStringValue&quot;</value> 

Or easier:

<value>'MyStringValue'</value> 

And double-quoting ('"MyStringValue"') is when you're using arguments.

OTHER TIPS

I use the same approach for passing DEFINE params via loading custom-config and all works fine. I don't see error in the part of config you provided.

Here is my variant of config and mxmlc params:

-load-config tools/config-local.xml -dump-config=local-dumped-config.xml. 

Also check the dump config to be sure defines were included.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top