User Guide

Basic MXML syntax 39
The following example shows how you specify an anonymous object as the value of the
dataProvider property:
<mynamespace:MyComponent>
<mynamespace:dataProvider>
<mx:Array>
<mx:Object label="One" data="1" />
<mx:Object label="Two" data="2" />
</mx:Array>
</mynamespace:dataProvider>
</mynamespace:MyComponent>
Properties that contain XML data
If a component contains a property that takes XML data, the value of the property is an XML
fragment to which you can apply a namespace. In the following example, the
value property of
the MyComponent object is XML data:
<mynamespace:MyComponent>
<mynamespace:value xmlns:a="http://www.example.com/myschema">
<mx:XML>
<a:purchaseorder>
<a:billingaddress>
...
</a:billingaddress>
...
</a:purchaseorder>
</mx:XML>
</mynamespace:value>
</mynamespace:MyComponent>
Style properties
A style property of an MXML tag differs from other properties because it corresponds to an
ActionScript style property that you set in ActionScript using the
setStyle(stylename,
value)
method rather than object.property=value notation. The text and fontFamily
properties in the following example:
<mx:TextArea id="myText" text="hello world" fontFamily="Tahoma"/>
are equivalent to the following ActionScript code:
// text property:
myText.text= "hello world";
// font style property:
myText.setStyle("fontFamily", "Tahoma");