Flex 3处理外部XML的两种方法
来源:互联网 发布:淘宝算命 编辑:程序博客网 时间:2024/05/16 19:29
点击这里使用RSS订阅本Blog:
<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】
- Flex 3处理外部XML的两种方法
- Flex读取外部XML文件的几种方法
- Flex读取XML文件的两种方法
- Flex读取XML文件的两种方法
- Flex读取XML文件的两种方法
- Flex读取XML的两种方式
- asp.net处理XML文件的两种方法
- Flex 添加效果的两种方法
- 关于处理xml的两种方法,xmlPullParser与Dom解析的两种
- HTML加载外部css文件的两种方法
- 引用外部css的两种方法与@import
- ant中调用外部ant任务的两种方法
- ant中调用外部ant任务的两种方法
- 在Unity3D中加载外部图片的两种方法
- 在Unity3D中加载外部图片的两种方法
- 在Unity3D中加载外部图片的两种方法
- 在Unity3D中加载外部图片的两种方法
- 两种引用外部CSS文件的方法
- 猫吃老鼠 2
- C#怎样执行DOS批处理文件
- SNMP大乱转
- SYMBIAN代码注意事项
- Erlang: Scalaris 以及内建的 json parser 支持
- Flex 3处理外部XML的两种方法
- linux设置环境变量
- 给ocx控件做数字签名
- HKC G801手机中相机及视频问题修改方法
- 服务,服务,服务的价值!
- jspSmartUpload上传下载全攻略
- vba Err.Number
- 发一个XML操作类(正则版)
- ioctl函数的一些问题