<mx:dataProvider>
<mx:Array>
<mx:String>Dogs</mx:String>
<mx:String>Cats</mx:String>
<mx:String>Mice</mx:String>
</mx:Array>
</mx:dataProvider>
</mx:ComboBox>
</mx:VBox>
The following example shows an application that uses the MyComboBox component as a custom
tag. The value * assigns the local namespace to the current directory.
<?xml version="1.0"?>
<!-- MyApplication.mxml -->
<mx:Application xmlns:mx="http://www.macromedia.com/2003/mxml"
xmlns:local="*">
<mx:Panel title="My Application" marginTop="10" marginBottom="10"
marginLeft="10" marginRight="10" >
<local:MyComboBox/>
</mx:Panel>
</mx:Application>
The following figure shows the application rendered in a web browser window:
For more information about MXML components, see Chapter 15, "Building an Application with
Multiple MXML Files," in Developing Flex Applications.
You can also define custom Flex components in ActionScript and the Flash MX 2004 authoring
tool. For more information, see
Using XML namespaces
In an XML document, tags are associated with a namespace. XML namespaces let you refer to
more than one set of XML tags in the same XML document. The
tag specifies an XML namespace. To use the default namespace, specify no prefix. To use
additional tags, specify a tag prefix and a namespace. For example, the
following
<mx:Application>
The Universal Resource Identifier (URI) for the MXML namespace is
http://www.macromedia.com/2003/mxml.
<mx:Application xmlns:mx="http://www.macromedia.com/2003/mxml" >
34
Chapter 2: Using MXML
Chapter 3, "Using ActionScript."
tag indicates that tags in the MXML namespace use the prefix mx:.
property in an MXML
xmlns
property in the
xmlns
Need help?
Do you have a question about the FLEX-GETTING STARTED WITH FLEX and is the answer not in the manual?
Questions and answers