Actionscript config constants in source

I have projects that use config constants to provide configuration based variations.  But every place I use them shows as an error.

The error is "Unresolved variable or type CONFIG" no matter how I use it. For example:

private var _orientation : int;


private function setup() : void

addEventListener(MouseEvent.MOUSE_MOVE, moved);

if (CONFIG::air)


// respond the initial touch on a tablet

addEventListener(MouseEvent.MOUSE_DOWN, moved);


In all cases "CONFIG" is highlighted in red and the rest ("::air") is black.

Does anybody know a way to resolve the error?

Comment actions Permalink

Project Structure | Modules | [your Flash module] | [your Flash build configuration subnode] | Compiler Options tab, click to the right from 'Conditional Compielr Definitions' option, the button will appear, click it (or press Shift+Enter), dialog will open, click [+] (or press Alt+Insert), type contant name like 'CONFIG::air' and value.

Alternatively you may add the followint to the 'Additional compiler options' field ath the same Compiler Options tab:

-define+=CONFIG::air,true -define+=CONFIG::other,false

Comment actions Permalink


That works.  Just as I expect it should.  I thought I had tried it, but obviously not.

It would be nice if I could get the value in the tooltip like I get for constants.  Multiple values from different build targets could be presented as a list.  Or maybe it only shows the default.

It would also be nice to assign a unique color to these to make them more visible as I get into more multi-platform work.

Mostly I'm just happy they're not red any more.


Please sign in to leave a comment.