How to declare compile options as valid symbols in Flex?

I've got the following Flex code in an MXML file:

    <mx:Label id="lblVersion" styleName="versionID" bottom="0" right="10" text="Version { BUILD::version }"/>

where the "BUILD::version" is meant to be substituted from symbols defined in compiler options:

     -define BUILD::version "'LOCAL'"

The Flex plugin doesn't seem to understand the compiler option usage syntax and flags "BUILD" and "version" as "unresolved variable or type"

Is there a way around this problem?



Comment actions Permalink

Please configure conditional compiler definitions at Advanced tab of Flex Compiler Settings (or Flex facet settings).
If you are using custom compiler configuration file (Advanced tab is disabled in this case) - then specify them just inside your configuration file.

Additional compiler options field should be used only for those settings that can't be set in other UI controls.

Comment actions Permalink

That was the answer, of course. Thank you for the advice. When I added a BUILD::version value to the Conditional compilation defintions (on the Advanced tab) it was correctly compiled.

Just a side note:  this project was created by importing an existing FlexBuilder project. It appears that the FlexBuilder "Additional compiler arguments" was copied into the "Additional compiler options" field in the Facet.

For me, the FlexBuilder "Additional compiler arguments" field looked like:

     -locale en_US zh_CN -define BUILD::debug true -define BUILD::version "'LOCAL'"

It now appears that, during the import process, the "-define" clauses should have been moved to the "Conditional compilations" section, and were not.

Should this be reported as a defect in the import process?


Please sign in to leave a comment.