I am trying to use the "define" mxmlc compiler option to embed compile-time constants into my SWF files.
<mxmlc ...>
<define name="NAMES::PluginCompileTime" value="Hello World!"/>
</mxmlc>
I can access this variable if I "hardcode" it into my codebase, as so:
public static const PLUGIN_COMPILED_TIME:String = NAMES::PluginCompileTime;
However, I would like to be able to do this at runtime using something like getDefinitionByName():
var value:* = flash.utils.getDefinitionByName("NAMES::PluginCompileTime");
This throws the following error:
ReferenceError: Error #1065: Variable PluginCompileTime is not defined.
Does anyone know of a way to accomplish loading a compile-time constant in a namespace at runtime?