Very nice way to display xml in a readable form (with little effort!)
<`mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" color="#27148A"
backgroundGradientColors="[#1D4184, #020000]"
creationComplete="init()"
initialize="stats.send()"
width="730" height="600">
<`mx:Script>
<`![`CDATA[
import mx.collections.ArrayCollection;
import mx.rpc.events.ResultEvent;
[Bindable]
private var datars:ArrayCollection;
private function resultHandler(event:ResultEvent):void{
datars = event.result.assets.asset;
}
]]>
<`mx:HTTPService id="stats" url="http://www.spore.com/rest/assets/search/TOP_RATED/0/100" result="resultHandler(event)"/>
<`mx:DataGrid dataProvider="{datars}" x="30" y="20" height="500">
<`mx:columns>
<`mx:DataGridColumn dataField="name" headerText="Name" width ="120" />
<`mx:DataGridColumn dataField="rating" headerText="Rating" width ="50" />
<`mx:DataGridColumn dataField="description" headerText="Description" width = "500" />
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment