According to Senocular, this is all about compilation order. There is no explicit way to establish this order.
You can define built-in constants using the define parameter to avoid this problem.
Another way is to create a library containing constants. Libraries are included in front of user classes. To create a library, use the component compiler :
compc -output lib\Constants.swf -source-path src -include-classes Constants
When compiling the application, enable this library:
mxmlc -include-libraries lib\Constants.swf -- src\Main.as
Remember to recompile the library when changing constants or use a script construct that takes care of this.
A brief comment on the sample code:
The interface does not need to use this constant, it will have any value and will have the same effect on the implementation of classes.
AS3 Programming - Interfaces
A method that implements such a function declaration must have a default parameter value that is a member of the same data type as the value specified in the interface definition, but the actual value must not match.
source share