3
votes

I'm tasked with updating a Flex project created by an outside contractor and in the Actionscript is the following chunk:

CONFIG::FLASH_10_1
{
    //Some code here
}

I've never seen this type of structure before and I'm having a heck of a time trying to search for it on Google - I've found what it means in just about every programming language except AS3. Can anyone shed some light on this?

3
I should probably add that currently the project is throwing an error at this line that reads: "1120: Access of undefined property FLASH_10_1" - TheOx

3 Answers

7
votes

I'm pretty sure this relates to the conditional compilation features of the Flex compiler.

So, if you add a compiler argument, like this:

-define=CONFIG::FLASH_10_1

I bet that error will go away.

4
votes

Although this is not the same context, to answer the question of what double colon "::" means in AS3...

It is a namespace accessor.

For example, the AS3 Vector.<T> type actually has a runtime type name of __AS3__.vec::Vector.<T>, where __AS3__.vec is the custom namespace. You can also use custom namespaces for members and access them on objects in AS3 using the syntax object.custom_namespace::membername. public and private are built in namespaces, so technically you could access public members like object.public::membername, as in:

var a:Array = [0,1];
trace(a.public::length); //prints 2
2
votes

Not a flex / AS3 guru - this thread talks about the '::' being used as a "Namespace accessor":

Thread on Actionscript FAQs