Thursday, January 26, 2012

Fully Qualified Class Name in ActionScript

To avoid naming conflicts, the fully qualified class name is used.  However, unlike Java, where you can simply use the fully qualified class name without doing an import, in ActionScript, you still have to do an import.

For example, say, you have two classes "playingtree.AwesomeClass" and "dancingtree.AwesomeClass"   Since the class name is the same, you have to use the fully qualified class name; otherwise, you would get a compiler error, because it doesn't know which class you refer to.  To solve this, you use the fully qualified name, meaning that you specify the class along with the package.  This is for those who are unfamiliar with it.

In summary, what's important to note here is that in ActionScript, you still have to do an import before you can use the fully qualified name.

No comments:

Post a Comment