Using the flex 4 language namespace for personal gain
In a previous post, I covered the seperation of the language namespace and the component namespace in Flex 4 SDK. Today I’d like to talk more about what the language namespace is and how it has changed in gumbo. What I want to talk about is the role of the language namespace and why it is special.
Elements in the language namespace are elements in mxml that can not be mapped to ActionScript components. These tags make up the base of the mxml language. In Flex 3 these tags included
- mx:Binding
- mx:Component
- mx:MetaData
- mx:Model
- mx:Repeater
- mx:Script
- mx:Style
These tags are what really make up the mxml language in flex 3. Every other tag you may have used was part of the halo component library or an AS3 class that someone had written (technically there are a couple compiler tags too, but we will skip those) All of these language tags are available in mxml 2009 with the addition of a few more including:
- Declarations
- Definition
- DesignLayer
- Library
- Private
- Reparent
Specifying the xmlns to either http://www.adobe.com/2006/mxml or http://ns.adobe.com/mxml/2009 you are choosing which version of the language you want to use. As you begin developing applications using mxml 2009 and the gumbo components you will find yourself integrating some of these new tags into your applications right away. For instance when declaring non-visual (classes that do not extend DisplayObject) items those must be instantiated inside the Declarations section of your application, or used in side a library element.
Beyond the additional tags that have been added to the mxml 2009 another key behavior has been modified. The default property metadata tag is no longer ignored when compiling your application. What this means is that if a class has a default property defined, any immediate children of the class will be interpreted as values for the default property. This is an amazingly powerful addition to the language because it means with some very minor changes as3 only frameworks can be utilized from mxml (but without the bloat of the flex framework).
I have some additional posts with examples of using the new elements coming in the next month. I just have to get through my family trip to Italy and my presentation at MAX Europe before I can finish them. With that… tune in next time for some more flex 4 fun.
But for more information on these new elements check out the MXML 2009 Specification Documentation on Adobe’s open source site.

Simeon said, “This is an amazingly powerful addition to the language because it means with some very minor changes as3 only frameworks can be utilized from mxml (but without the bloat of the flex framework).”
This is beautiful, and exactly what I’ve been looking for. A flex 3 example is here:
http://pv3d.org/2009/03/17/mxml-without-the-flex-framework/
Using Flex 4, things are much cleaner. Very cool.
“…with some very minor changes as3 only frameworks can be utilized from mxml (but without the bloat of the flex framework).â€
Anyone else following up on this use of the MXML ‘language” … ?
I have had some limited success myself.
Greg