Flex中对XML的操作 以远程XML为例 ,其实最开始试验的时候,是用本地的项目文件夹里的一个xml文件当做远程URL去访问的,也可以。 <mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml" width="400" height="100" creationComplete="init()"> <mx:Script> <![CDATA[ internal function init():void{ var xmlpath :String ="../xml/content.xml"; var urlRequest : URLRequest = new URLRequest(xmlpath); urlLoader = new URLLoader(urlRequest); urlLoader.addEventListener(Event.COMPLETE,xmlLoaded); httpService.send(); } internal function resultHandler(evt:ResultEvent):void{ collection= evt.result.银行贷款申请流程.TaskModel; } ]]> </mx:Script> <mx:HTTPService id="httpService" url="../xml/content.xml" result="resultHandler(event)"/> <mx:Label id="lb" x="10" y="10" text="Label" width="318"/> </mx:Canvas>