Flex 2 Namespacing Methods and Properties Example

Posted on November 9, 2006 | 3 comments

I came across the Namespace class while looking up some information about ActionScript 3.0′s E4X and XML. I didn’t know, will lets say, I didn’t make the connection between the Namespace class and using it with methods and properties of components. This example is very basic and is not meant to be a good use of namespaces. It shows how to use it for methods and properties.

In the example there is one method name and one property name to change a button from being rounded or square looking and being filled with red or blue colors.

Live Example Here

You can right click on the swf to view the source.

  • http://www.tink.ws/blog Tink

    Never used em either. Thanks for the example!

  • http://www.zeuslabs.us Josh Tynjala

    Cool. Another interesting way to use namespaces like this would be to support runtime language localization.

  • http://www.renaun.com Renaun Erickson

    Actually the documentation showed that very example. I did not think that was the best way because there is the resources bundles method to do language localization. But if you needed run-time localization, it would be a decent approach to the problem.