Adobe Dreamweaver Forums



Last 10 THreads :         How to show double byte data in a Flex application (Last Post : Videogy - Replies : 4 - Views : 20 )           »          Controling a Virtual Keyboard from Director MX (Last Post : RandallH - Replies : 0 - Views : 1 )           »          CF8 Help in Dreamweaver CS3 (Last Post : A.J.cfm - Replies : 0 - Views : 1 )           »          Focus, Browsers & Spry Accordion (Last Post : Al Sparber - PVII - Replies : 4 - Views : 5 )           »          linking to a database using xml (Last Post : Dooza - Replies : 17 - Views : 18 )           »          dreamweaver v. movable type? (Last Post : anniemosie - Replies : 0 - Views : 1 )           »          SWF slide show does not play (Last Post : hammerkp - Replies : 0 - Views : 1 )           »          Nav Bar images missing in generated help (Last Post : eoprigjernt - Replies : 4 - Views : 5 )           »          FlashVars help (Last Post : kglad - Replies : 1 - Views : 2 )           »          Adobe Flex 3 with AIR Certification Exam is Now Out !!! (Last Post : glen08 - Replies : 1 - Views : 2 )           »         


Home Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
User Info Statistics
Go Back   Adobe Dreamweaver Forums > Other Macromedia/Adobe Products > Flex
 
Tags: ,



Reply
  #1 (permalink)  
Old 08-26-2008, 07:41 PM
projectproofing
 
Posts: n/a
Diggs:
Default Re: XML and 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



Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 08-26-2008, 08:22 PM
Greg Lafrance
 
Posts: n/a
Diggs:
Default Re: XML and XMLListCollection

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 dgataGrid = 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"/>
<mxataGrid dataProvider="{RSSFeed}" id="feedsDG"
doubleClick="openURL(event);"
doubleClickEnabled="true">
<mx:columns>
<mxataGridColumn headerText="Title" dataField="title" width="200"/>
<mxataGridColumn headerText="Link" dataField="link" width="200"/>
</mx:columns>
</mxataGrid>
</mx:Application>

Reply With Quote
  #3 (permalink)  
Old 08-27-2008, 05:41 AM
g-s-b
 
Posts: n/a
Diggs:
Default Re: XML and XMLListCollection

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" />

<mxataGrid id="feedsDG"
dataProvider="{RSSFeed}"
doubleClick="navigateToURL(new URLRequest(
feedsDG.selectedItem.link ), '_blank' );"
doubleClickEnabled="true">
<mx:columns>
<mxataGridColumn headerText="Title" dataField="title"
width="200"/>
<mxataGridColumn headerText="Link" dataField="link" width="200"/>
</mx:columns>
</mxataGrid>

</mx:Application>

Reply With Quote


Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



© Camley Interactive (camley.info) 2008 - all logos and images are copywrite their respective owners.
Proud member of the Camley Interactive Network
All times are GMT. The time now is 05:33 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.
Cheap Car Insurance - Compare Motor Insurance
Endsleigh Car Insurance Natwest Car Insurance
More Than Car Insurance Norwich Union Car Insurance
Prudential Car Insurance Zurich Car Insurance
Inactive Reminders By Mished.co.uk