Views
Replies
Total Likes
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
layout="horizontal" horizontalAlign="left"
backgroundGradientColors="[0x000000,0x323232]"
applicationComplete="srv.send()" viewSourceURL="srcview/index.html">
<mx:NumberFormatter id="nf"/>
<!-- resultFormat tells the HTTPService how to deserialize the result of the HTTP request.
By default, the response is deserialized into an object graph. This allows you to navigate through
the service result using the dot notation.
You can also get the result as an XML document by specifying resultFormat="e4x" on the HTTPService.
In that case, you can parse the document using E4X (ECMAScript for XML). -->
<mx:HTTPService id="srv" url="items.xml" resultFormat="e4x"/>
<mx:Tree id="tree" dataProvider="{srv.lastResult}" labelField="@name"
width="300" height="100%"/>
<mx:Form>
<mx:FormItem label="Population:">
<!-- e4x data binding expression -->
<mx:TextInput text="{nf.format(tree.selectedItem.@population)}"/>
</mx:FormItem>
<mx:FormItem label="Capital:">
<!-- e4x data binding expression -->
<mx:TextInput text="{tree.selectedItem.@capital}"/>
</mx:FormItem>
</mx:Form>
<mx:Style>
FormItem {
labelStyleName: formItemLabel;
}
.formItemLabel {
color: #FFFFFF;
}
</mx:Style>
</mx:Application>
Views
Replies
Total Likes