|
I have never liked Model, a personal
problem, I know. Below is an example using HTTPService, my best
friend. Debugging binding is hard, so I almost always use a result handler,
again as below. Note that it assumes the xml file in in an assets folder.
Change that if necessary. <?xml version="1.0"
encoding="utf-8"?> <mx:Application
xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"
creationComplete="dsVideos.send();"> <mx:Script><![CDATA[ import mx.collections.XMLListCollection; import mx.rpc.events.ResultEvent; private function
onResult(oEvent:ResultEvent):void { var xlcDP:XMLListCollection
= new XMLListCollection(oEvent.result.titles.title); list1.dataProvider = xlcDP;
//assign XML XMLList to data Provider }//onResult private function
lfnConcat(item:Object):String { return (item.className +
" (" + item.duration + " hrs.)"); }//lfnConcat ]]></mx:Script> <mx:HTTPService
id="dsVideos" url=""
result="onResult(event)" resultFormat="e4x"/> <mx:List
id="list1" labelFunction="lfnConcat"
width="300"/> </mx:Application> -- videoTitles.xml -- <?xml version="1.0"?> <root> <titles> <title> <className>Flash
User Experience Best Practices</className> <duration>4.25</duration> </title> <title> <className>Flash
Professional 8 New Features</className> <duration>1.0</duration> </title> <title> <className>Flash
Professional 8 Essential Training</className> <duration>11.5</duration> </title> <title> <className>Flash
Professional 8 Beyond the Basics</className> <duration>10</duration> </title> <title> <className>Flash
Professional 8 Video Integration</className> <duration>7.25</duration> </title> <title> <className>Photoshop
CS2 and Flash 8 Integration</className> <duration>2.5</duration> </title> </titles> </root> From:
[email protected] [mailto:[EMAIL PROTECTED] On Behalf Of John Mazzocchi Hi, newbie question here ... just learning. I'm using
Flex 2. There seem to be numerous errors and typos in the Adobe Flex Help
files/PDFs and I'm hitting a snag here ... -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com YAHOO! GROUPS LINKS
|

