点击这里使用RSS订阅本Blog: title="RSS 2.0" type="application/rss+xml" href="http://feed.feedsky.com/softwave" rel="alternate">
<script language="javascript">
</script> <script language="javascript" src="http://www.feedsky.com/jsout/publishlist_v2.js?burl=softwave&out_html=true"></script>
<script type="text/javascript" src="http://www.google.com/reader/ui/publisher.js"></script> <script type="text/javascript" src="http://www.google.com/reader/public/javascript/user/00697638153916680411/state/com.google/broadcast?n=5&callback=GRC_p%28%7Bc%3A%22green%22%2Ct%3A%22%5Cu8FD9%5Cu4E9B%5Cu6587%5Cu7AE0%5Cu4E5F%5Cu503C%5Cu5F97%5Cu4E00%5Cu770B%22%2Cs%3A%22false%22%7D%29%3Bnew%20GRC"></script>
其一,用mx:Model:
- <?xml version="1.0"?>
- <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
- <mx:Model id="catalogService" source="catalog.xml" />
- <mx:ArrayCollection id="myXC" source="{catalogService.product}"/>
- <mx:Repeater id="r" dataProvider="{myXC}" startingIndex="1">
- <mx:RadioButton id="Radio" label="{r.currentItem.name}"/>
- </mx:Repeater>
- </mx:Application>
其二:用mx:HTTPService:
- <?xml version="1.0"?>
- <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" initialize="catalogService.send()">
- <mx:HTTPService id="catalogService" url="catalog.xml" resultFormat="e4x"/>
- <mx:XMLListCollection id="myXC" source="{catalogService.lastResult.product}"/>
- <mx:Repeater id="r" dataProvider="{myXC}" startingIndex="1">
- <mx:RadioButton id="Radio" label="{r.currentItem.name}"/>
- </mx:Repeater>
- </mx:Application>
其中,XML数据如下:
- <?xml version="1.0"?>
- <products>
- <product>
- <name>Name</name>
- <price>Price</price>
- <freeship>Free Shipping?</freeship>
- </product>
- <product>
- <name>Whirlygig</name>
- <price>5</price>
- <freeship>false</freeship>
- </product>
- <product>
- <name>Tilty Thingy</name>
- <price>15</price>
- <freeship>true</freeship>
- </product>
- <product>
- <name>Really Big Blocks</name>
- <price>25</price>
- <freeship>true</freeship>
- </product>
- </products>
请注意数据集的细微差别。
摘自【http://www.5uflash.com/Flex-AIR/flexziliao/list_17_2.html】