![]() |
![]() |
||||||
|
|||||||
| Tags: xml, xmllistcollection |
![]() |
|
|||
|
Also should note I am getting this error:
[RPC Fault faultString="[MessagingError message='Destination 'http://www2.med.umich.edu/prmc/media/all.xml' either does not exist or the destination has no channels defined (and the application does not define any default channels.)']" faultCode="InvokeFailed" faultDetail="Couldn't establish a connection to 'http://www2.med.umich.edu/prmc/media/all.xml'"] You can see that the destination does exist and there is a channel |
| Sponsored Links |
|
|||
|
Examine my simplified code, which works, to see what I changed:
<?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" creationComplete="getXML.send()"> <mx:Script> <![CDATA[ import mx.collections.XMLListCollection; import flash.net.navigateToURL; import flash.net.URLRequest; import mx.rpc.events.ResultEvent; [Bindable] public var RSSFeed:XMLListCollection = new XMLListCollection(); public function resultHandler(e:ResultEvent):void { var list:XMLList = new XMLList(e.result..item); RSSFeed = new XMLListCollection(list); } public function openURL(event:MouseEvent):void { var dg ataGrid = event.currentTarget as DataGrid;var str:String = dg.selectedItem.link; navigateToURL(new URLRequest(str),"_blank"); } ]]> </mx:Script> <mx:HTTPService id="getXML" url="http://www2.med.umich.edu/prmc/media/all.xml" result="resultHandler(event)" resultFormat="e4x" useProxy="false"/> <mx ataGrid dataProvider="{RSSFeed}" id="feedsDG"doubleClick="openURL(event);" doubleClickEnabled="true"> <mx:columns> <mx ataGridColumn headerText="Title" dataField="title" width="200"/><mx ataGridColumn headerText="Link" dataField="link" width="200"/></mx:columns> </mx ataGrid></mx:Application> |
|
|||
|
Here is how I might go about the same (based on Greg's code):
<?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" creationComplete="getXML.send()"> <mx:HTTPService id="getXML" url="http://www2.med.umich.edu/prmc/media/all.xml" resultFormat="e4x" useProxy="false" result="RSSFeed.source=getXML.lastResult..item" fault="mx.controls.Alert.show('\n\nXML data acquisition failed.\nTry refreshing your browser.\n ','Data Error')" /> <mx:XMLListCollection id="RSSFeed" /> <mx ataGrid id="feedsDG"dataProvider="{RSSFeed}" doubleClick="navigateToURL(new URLRequest( feedsDG.selectedItem.link ), '_blank' );" doubleClickEnabled="true"> <mx:columns> <mx ataGridColumn headerText="Title" dataField="title"width="200"/> <mx ataGridColumn headerText="Link" dataField="link" width="200"/></mx:columns> </mx ataGrid></mx:Application> |
![]() |
| Thread Tools | |
| Display Modes | |
|
|
- Contact Us
-|-
Adobe Dreamweaver Forums -|-
Archive -|-
Top -|-Rules/Disclaimer-|-Help/Support-|-Advertise