Thanks Jeff, That seemed to work great! The next question that I have is once I have the xml loaded in, how do I go about working with it. Basically what I want to do is access the attributes of two child nodes and use them as the dataProviders for the field and fieldName properties of a piechart component.. My test xml looks like this:
<gender> <male label="male" percent="30" /> <female label="female" percent="70" /> </gender> I am open to any suggestions you may have if you have a better way of formatting the xml to make it easier to use. Also, do you know of any good sites that have solid flex2 tutorials? I've pretty much exhausted everything I've found on the web thus far and am still finding myself confused.. Thanks again for all the help! --- In flexcoders@yahoogroups.com, Jeff Tapper <[EMAIL PROTECTED]> wrote: > > try this: > <?xml version="1.0" encoding="utf-8"?> > <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" > creationComplete="initApp()" > layout="absolute"> > > <mx:Script> > <![CDATA[ > import flash.net.*; > import flash.events.*; > private var myLoader:URLLoader; > private var myXML:XML = new XML(); > private function initApp():void{ > var XML_URL:String = "order.xml"; > var myXMLURL:URLRequest = new URLRequest(XML_URL); > myLoader = new URLLoader(myXMLURL); > myLoader.addEventListener("complete" ,xmlLoaded); > } > > private function xmlLoaded(evtObj:Event):void { > myXML = XML(myLoader.data); > trace("Data loaded."); > trace(myXML); > } > ]]> > </mx:Script> > > </mx:Application> > > > At 12:15 AM 8/29/2006, Kyle wrote: > > >Hello all, > >I am a somewhat seasoned veteran in Flash, but am finding myself > >having a lot of trouble with Flex. I am trying to do a simple XML load > >from an external file and am running into a lot of errors. The two > >reported errors are: > > > >1) Access of undefined property myLoader > >2) Access of undefined property xmlLoaded > > > >Any help that anyone can provide, or any links to some simply flex2 > >xml loading tutorials would be greatly appreciated! > > > >Thanks, > > > > > >Kyle > > > > > > > >My complete mxml code looks is as follows: > > > ><?xml version="1.0" encoding="utf-8"?> > ><mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" > >layout="absolute"> > > > > <mx:Script> > > <![CDATA[ > > import flash.net.*; > > import flash.events.*; > > > > var myXML:XML = new XML(); > > var XML_URL:String = "order.xml"; > > var myXMLURL:URLRequest = new URLRequest(XML_URL); > > var myLoader:URLLoader = new URLLoader(myXMLURL); > > myLoader.addEventListener("complete" ,xmlLoaded); > > > > function xmlLoaded(evtObj:Event) { > > myXML = XML(myLoader.data); > > trace("Data loaded."); > > } > > ]]> > > </mx:Script> > > > ></mx:Application> > > > > > ><!--------------------------------------------------------------> > > > > > > > > > > > > > > > >-- > >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 > > > > > > > > > -- 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 <*> To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/