Publishers of technology books, eBooks, and videos for creative people

Home > Blogs > Namespaces, Five ActionScript Tips in Five Days, Part 2

Namespaces, Five ActionScript Tips in Five Days, Part 2

ActionScript 3 namespace definition keywords are extremely powerful and can really simplify your code.

A namespace is essentially a custom keyword that controls the visibility of class properties and methods. For such a powerful feature, a namespace is pretty simple to use: You just put it in place of the access control modifier for a class property or method.

Note: An access control modifier is the technical version of private, public, protected, and internal.

The true benefit of a namespace is the ability to assign specific properties or methods during development and differentiate those properties and methods based on the namespace in use during runtime.

The example code is just one simple way to use namespace definition keywords. There is a lot more depth to namespaces, and I highly recommend checking them out.

Keep your eyes out for more ActionScript 3 tips like these each day this week.

And for more on ActionScript, be sure to check out my book ActionScript 3.0 Migration Guide, The: Making the Move from ActionScript 2.0.