namespace

Now that Flex SDK 4 was released, I thought I'd do a series of posts on the differences between Flex 3 and Flex 4 SDKs that will hopefully help migrate your Flex 3 app to Flex 4 or make the transition from SDK 3 to SDK 4 easier. I will be assuming you already know Flex 3 and will concentrate on the new in Flex 4 compared to Flex 3.

This post will serve as the index of the series, and I will be adding links to the different posts to this one as they become available, so come back from time to time to get updated.

 

sefi 21/04/2010 - 07:33

Hello!

Today, we are going to discuss introspection and private namespaces in AS3/Flex!

 

The motivation to use private namespaces in the context of introspection is to be able to expose API implemented in your class in a way that is not public (everyone can use it), protected (only inheriting classes can use it) or private (only the class can use it).

 

Consider this: You are implementing a framework, and one of the classes (ClassA) is used both by the framework users (external) and within the framework (internal). That means that all the functionality in ClassA that is intended for external use must be public. Unfortunately, so does the functionality intended for internal use.

 

sefi 14/10/2009 - 11:35

Flex 4 added some namespaces, while it still supports the Flex 3 namespaces. This can cause some confusion, more so since some classes are part of two namespaces.

 

While Flex3 used only one namespace (xmlns:mx="http://www.adobe.com/2006/mxml"), Flex4 uses 3 namespaces:
xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
Note, that while there's still a mx namespace, the URI is different.

 

Each namespaces defines a component set. The old Flex3 mx namespace is still active but if you use it Flex 4 features will not be available.

 

The fx:namespace includes top-level AS building blocks such as Object, Array etc. but does not include any of the mx or spark component sets. It also includes some mxml tags, like <fx:script>, <fx:style> and <fx:declarations>.

sefi 21/04/2010 - 07:35
Syndicate content