1个回答
展开全部
<?xml version=”1.0″?>
<books>
<item>
<title>The Complete Guide to Flex 2 and ActionScript 3.0</title>
</item>
<item>
<title>Programming Flex 2 (Programming)</title>
</item>
</books>
<?xml version=”1.0″ encoding=”utf-8″?>
<mx:Application xmlns:mx=”http://www.adobe.com/2006/mxml” layout=”absolute”
initialize=”myService.send()”>
<mx:Script>
<![CDATA[
import mx.collections.ArrayCollection;
import mx.rpc.events.ResultEvent;
[Bindable]
private var myData:ArrayCollection;
private function resultHandler(event:ResultEvent):void {
myData = event.result.books.item;
}
]]>
</mx:Script>
<mx:HTTPService id=”myService”
url=”books.xml”
result=”resultHandler(event)”/>
<mx:Text id=”something” text=”{myData.getItemAt(0).title}”/>
</mx:Application>
追问
额,我是说从磁盘读取TXT文件内容, 亲
追答
....url可以是C:/test.xml大哥。。
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询