That would explain why it cannot find it. -doh
Thanks for all your help. --- In flexcoders@yahoogroups.com, "Tracy Spratt" <[EMAIL PROTECTED]> wrote: > > Regarding trace, I am pretty sure that whatever you mean by "...told it > to print to a text area through binding.", won't work. Trace() sends > output to the flashlog.txt file. Seting up tracing involves creating / > modifying the mm.cfg file. Its documented in the developer's guide. > > > > Instead of tracing you can use Alert, or you can assign whatever data > you want to the textArea.text property. Or you can use the debugger. > Whatever debugging method you choose, you want to be able to see exactly > what your result object contains. Otherwise you just have to guess > until you get the references right. > > > > One major benefit of XMLListCollection (or ArrayCollection) is that > their methods, like addItem(), emit the necessary events to make the > Flex controls visually update. XMLList and Array methods do not. > > > > Also, if you are using e4x with XMLLIstCollection, at any point you need > you can trace out myXMLItem.toXMLString() and see exactly what the > current node contains. > > > > To use these classes you must import them: > > import mx.collections.XMLListCollection; > > Tracy > > > > ________________________________ > > From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On > Behalf Of jnewport > Sent: Thursday, September 21, 2006 10:03 AM > To: flexcoders@yahoogroups.com > Subject: [flexcoders] Re: ArrayCollection returns object Object > > > > --- In flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com> > , "Tracy Spratt" <tspratt@> wrote: > > > > Yes, like that, especially the resultFormat="e4x", that is key. Forget > > mx:Model forever. > > > Tried this, but non of it worked. the trace function call throws an > error...not sure if I am doing it correctly. I put the trace call in > the resultHandler function and then told it to print to a text area > through binding. Still throws error...doesn't like the trace statement. > > I tried the other items you suggested and continously throws errors. > It says the XMLListColletion doesnt' exist. Think you mean XMLList > which I also tried and still throwing errors. > > I have used Jamies so far and it is working so far, but still having > issues with getting out the XML I want. Trying different XML format. > > Thanks, Jason > > > > > Just use evt.result. Use lastResult only in binding expressions. > > > > > > > > Also, in the resultHandler (your argument is typed correctly, Jamie's > > example is not), do: > > > > trace(event.result.toXMLString()) > > > > To see exactly what your XML is. I think you will find that result is > > already at the root node, so your would have: > > > > var monthData:XML = event.result.month; > > > > > > > > Would give you an XMLList or Month nodes. To use that for a list > > dataprovider, do: > > > > var xlcDP:XMLListCollection = new XMLListCollection(monthData); > > > > > > > > Tracy > > > > ________________________________ > > > > From: flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com> > [mailto:flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com> > ] On > > Behalf Of Jamie O > > Sent: Wednesday, September 20, 2006 1:43 PM > > To: flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com> > > Subject: [flexcoders] Re: ArrayCollection returns object Object > > > > > > > > I'll take my best attempt. > > > > 1) Create the XML variable you will need to map the HTTPService object > > data to and create a function that will handle the result call of your > > HTTPService call. > > <mx:Script> > > <![CDATA[ > > import mx.rpc.events.ResultEvent; > > > > [Bindable] > > private var xmldpAddress:XML; > > > > public function LoadXML(evt:Event):void { > > xmldpAddress = new XML(evt.target.lastResult); > > //Do other result-driven actions here > > } > > ]]> > > > > 2) In your HTTPService call a function to handle the result event: > > <mx:HTTPService > > id="feedRequest" > > url = "[PATH GOES HERE] > > useProxy="false" > > resultFormat="e4x" > > result="LoadXML(event)" > > /> > > > > 3) So when you trigger the request via feedRequest.send() function > > from either the creationComplete part of the application or a button > > event, it calls the service, the service calls your result function > > and the result function maps that service data object into an XML > > format. > > > > 4) As a result, you can then use dot notation for the XML in any > > dataprovider you want. > > > > <mx:TextInput x="139" y="143" width="151" id="txtProv" > > editable="false" enabled="false" text="[EMAIL PROTECTED]"/> > > > > At that point, the help page under Programming ActionScript 3.0 > Core > > ActionScript 3.0 Data Types and Classes > Working with XML > > > Traversing XML Structures should give you all the examples you need to > > bind the particular data you're looking for. > > > > Good luck! > > Jamie > > > > --- In flexcoders@yahoogroups.com > <mailto:flexcoders%40yahoogroups.com> > <mailto:flexcoders%40yahoogroups.com> > > , "jnewport" <jason_newport@> wrote: > > > > > > I was wondering if someone can help me (preference) or point me to a > > > tutorial on xml and data structures that are not hardcoded. > > > > > > I am using an HttpService to retreive xml and I can get result, but > > > when I use it to populate a List I get object Object. All livedocs > > > and info tells you how to use arrays, arraycollections, and xml when > > > the xml is hardcoded in the app. > > > > > > Here is my file and xml. > > > > > > FILE > > > <?xml version="1.0" encoding="utf-8"?> > > > <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml > <http://www.adobe.com/2006/mxml> > > <http://www.adobe.com/2006/mxml <http://www.adobe.com/2006/mxml> > " > xmlns="*" > > > paddingTop="3" > > > creationComplete="initApp()" > > > pageTitle="Dashboard"> > > > > > > <mx:Style source="OSX.css"/> > > > > > > <mx:Script> > > > <![CDATA[ > > > import mx.rpc.events.ResultEvent; > > > import mx.collections.ArrayCollection; > > > import mx.rpc.*; > > > import mx.charts.*; > > > > > > > > > [Bindable] > > > public var slicedMonthData:ArrayCollection; > > > > > > [Bindable] > > > public var slicedRegionData:ArrayCollection; > > > > > > [Bindable] > > > public var JasonsAC:ArrayCollection; > > > > > > private var monthData:Array; > > > private var regionData:Array; > > > > > > private function initApp():void > > > { > > > srv.send(); > > > slicedMonthData = new ArrayCollection(); > > > slicedRegionData = new ArrayCollection(); > > > } > > > > > > > > > private function resultHandler(event:ResultEvent):void > > > { > > > monthData = event.result.list.month.source as Array; > > > slider.maximum = monthData.length - 1; > > > slider.values = [0, monthData.length - 1]; > > > slicedMonthData.source = monthData; > > > JasonsAC = new ArrayCollection(slicedMonthData.source); > > > //regionBreakdown.month = monthData[0];// > > > > > > } > > > > > > private function getSliderLabel(value:String):String > > > { > > > return monthData[parseInt(value)].name; > > > } > > > > > > > > > > > > private function rangeChange():void > > > { > > > if (monthData != null) > > > slicedMonthData.source = > > > monthData.slice(slider.values[0], slider.values[1] + 1); > > > if (regionData != null) > > > slicedRegionData.source = regionData.slice(slider.values[0], > > > slider.values[1] + 1); > > > } > > > > > > > > > > > > ]]> > > > </mx:Script> > > > > > > <mx:HTTPService id="srv" url="results.xml" useProxy="false" > > > result="resultHandler(event)"/> > > > <mx:Model id="dataSet"></mx:Model> > > > > > > > > > > > > <mx:ApplicationControlBar width="100%" height="37"> > > > <mx:Spacer width="2"/> > > > <mx:Label text="Dashboard:"/> > > > <mx:ComboBox width="150"> > > > <mx:dataProvider> > > > <mx:Array> > > > <mx:String>Revenue Timeline</mx:String> > > > <mx:String>KWH Timeline</mx:String> > > > <mx:String>Member Timeline</mx:String> > > > </mx:Array> > > > </mx:dataProvider> > > > </mx:ComboBox> > > > <mx:Spacer width="10"/> > > > <mx:Label text="Select Period:"/> > > > <mx:HSlider id="slider" width="180" thumbCount="2" > > > snapInterval="1" minimum="0" dataTipPlacement="bottom" > > > dataTipFormatFunction="getSliderLabel" > > > change="rangeChange()"/> > > > </mx:ApplicationControlBar> > > > > > > <mx:HDividedBox width="100%" height="100%"> > > > <mx:HBox width="60%" height="100%"> > > > > > > <mx:Panel id="DistrictList" title="District List" width="25%" > > > height="100%"> > > > <mx:List id="districtList" dataProvider="{JasonsAC}" width="110" > > > height="100%" allowMultipleSelection="true" dragEnabled="true"/> > > > </mx:Panel> > > > > > > <mx:Panel id="ComparePanel" title="District Comparison" > > > width="75%" height="100%" /> > > > </mx:HBox> > > > > > > <mx:VDividedBox width="40%" height="100%"> > > > <mx:Panel id="MonthlyTotal" title="Monthly Total" width="100%" > > > height="100%" /> > > > <mx:Panel id="CycelTotals" title="Cycle Totals" width="100%" > > > height="100%" /> > > > </mx:VDividedBox> > > > </mx:HDividedBox> > > > > > > > > > </mx:Application> > > > > > > > > > XML > > > <list> > > > > > > <month name="Jan-04" revenue="400263" average="80052"> > > > <region name="APAC" revenue="46130"/> > > > <region name="Europe" revenue="106976"/> > > > <region name="Japan" revenue="79554"/> > > > <region name="Latin America" revenue="39252"/> > > > <region name="North America" revenue="128351"/> > > > </month> > > > > > > <month name="Feb-04" revenue="379145" average="75829"> > > > <region name="APAC" revenue="70324"/> > > > <region name="Europe" revenue="88912"/> > > > <region name="Japan" revenue="69677"/> > > > <region name="Latin America" revenue="59428"/> > > > <region name="North America" revenue="90804"/> > > > </month> > > > > > > <month name="Mar-04" revenue="389687" average="77937"> > > > <region name="APAC" revenue="60431"/> > > > <region name="Europe" revenue="140982"/> > > > <region name="Japan" revenue="58196"/> > > > <region name="Latin America" revenue="33373"/> > > > <region name="North America" revenue="96705"/> > > > </month> > > > > > > <month name="Apr-04" revenue="460329" average="92065"> > > > <region name="APAC" revenue="78969"/> > > > <region name="Europe" revenue="85885"/> > > > <region name="Japan" revenue="78107"/> > > > <region name="Latin America" revenue="65796"/> > > > <region name="North America" revenue="151572"/> > > > </month> > > > > > > <month name="May-04" revenue="351014" average="70202"> > > > <region name="APAC" revenue="64069"/> > > > <region name="Europe" revenue="82415"/> > > > <region name="Japan" revenue="96397"/> > > > <region name="Latin America" revenue="44627"/> > > > <region name="North America" revenue="63506"/> > > > </month> > > > > > > <month name="Jun-04" revenue="384855" average="76971"> > > > <region name="APAC" revenue="55331"/> > > > <region name="Europe" revenue="113196"/> > > > <region name="Japan" revenue="55371"/> > > > <region name="Latin America" revenue="58323"/> > > > <region name="North America" revenue="102634"/> > > > </month> > > > > > > <month name="Jul-04" revenue="335192" average="67038"> > > > <region name="APAC" revenue="39445"/> > > > <region name="Europe" revenue="110750"/> > > > <region name="Japan" revenue="73722"/> > > > <region name="Latin America" revenue="50595"/> > > > <region name="North America" revenue="60680"/> > > > </month> > > > > > > <month name="Aug-04" revenue="393654" average="78730"> > > > <region name="APAC" revenue="44801"/> > > > <region name="Europe" revenue="98806"/> > > > <region name="Japan" revenue="93673"/> > > > <region name="Latin America" revenue="50636"/> > > > <region name="North America" revenue="105738"/> > > > </month> > > > > > > <month name="Sep-04" revenue="472554" average="94510"> > > > <region name="APAC" revenue="61134"/> > > > <region name="Europe" revenue="136467"/> > > > <region name="Japan" revenue="93624"/> > > > <region name="Latin America" revenue="32293"/> > > > <region name="North America" revenue="149036"/> > > > </month> > > > > > > <month name="Oct-04" revenue="324299" average="64859"> > > > <region name="APAC" revenue="32078"/> > > > <region name="Europe" revenue="85420"/> > > > <region name="Japan" revenue="80483"/> > > > <region name="Latin America" revenue="64390"/> > > > <region name="North America" revenue="61928"/> > > > </month> > > > > > > <month name="Nov-04" revenue="415403" average="83080"> > > > <region name="APAC" revenue="58832"/> > > > <region name="Europe" revenue="143128"/> > > > <region name="Japan" revenue="64295"/> > > > <region name="Latin America" revenue="58261"/> > > > <region name="North America" revenue="90887"/> > > > </month> > > > > > > <month name="Dec-04" revenue="386089" average="77217"> > > > <region name="APAC" revenue="80555"/> > > > <region name="Europe" revenue="118981"/> > > > <region name="Japan" revenue="87520"/> > > > <region name="Latin America" revenue="27154"/> > > > <region name="North America" revenue="71879"/> > > > </month> > > > > > > <month name="Jan-05" revenue="400263" average="80052"> > > > <region name="APAC" revenue="46130"/> > > > <region name="Europe" revenue="106976"/> > > > <region name="Japan" revenue="79554"/> > > > <region name="Latin America" revenue="39252"/> > > > <region name="North America" revenue="128351"/> > > > </month> > > > > > > <month name="Feb-05" revenue="379145" average="75829"> > > > <region name="APAC" revenue="70324"/> > > > <region name="Europe" revenue="88912"/> > > > <region name="Japan" revenue="69677"/> > > > <region name="Latin America" revenue="59428"/> > > > <region name="North America" revenue="90804"/> > > > </month> > > > > > > <month name="Mar-05" revenue="389687" average="77937"> > > > <region name="APAC" revenue="60431"/> > > > <region name="Europe" revenue="140982"/> > > > <region name="Japan" revenue="58196"/> > > > <region name="Latin America" revenue="33373"/> > > > <region name="North America" revenue="96705"/> > > > </month> > > > > > > <month name="Apr-05" revenue="460329" average="92065"> > > > <region name="APAC" revenue="78969"/> > > > <region name="Europe" revenue="85885"/> > > > <region name="Japan" revenue="78107"/> > > > <region name="Latin America" revenue="65796"/> > > > <region name="North America" revenue="151572"/> > > > </month> > > > > > > <month name="May-05" revenue="351014" average="70202"> > > > <region name="APAC" revenue="64069"/> > > > <region name="Europe" revenue="82415"/> > > > <region name="Japan" revenue="96397"/> > > > <region name="Latin America" revenue="44627"/> > > > <region name="North America" revenue="63506"/> > > > </month> > > > > > > <month name="Jun-05" revenue="384855" average="76971"> > > > <region name="APAC" revenue="55331"/> > > > <region name="Europe" revenue="113196"/> > > > <region name="Japan" revenue="55371"/> > > > <region name="Latin America" revenue="58323"/> > > > <region name="North America" revenue="102634"/> > > > </month> > > > > > > <month name="Jul-05" revenue="335192" average="67038"> > > > <region name="APAC" revenue="39445"/> > > > <region name="Europe" revenue="110750"/> > > > <region name="Japan" revenue="73722"/> > > > <region name="Latin America" revenue="50595"/> > > > <region name="North America" revenue="60680"/> > > > </month> > > > > > > <month name="Aug-05" revenue="393654" average="78730"> > > > <region name="APAC" revenue="44801"/> > > > <region name="Europe" revenue="98806"/> > > > <region name="Japan" revenue="93673"/> > > > <region name="Latin America" revenue="50636"/> > > > <region name="North America" revenue="105738"/> > > > </month> > > > > > > <month name="Sep-05" revenue="472554" average="94510"> > > > <region name="APAC" revenue="61134"/> > > > <region name="Europe" revenue="136467"/> > > > <region name="Japan" revenue="93624"/> > > > <region name="Latin America" revenue="32293"/> > > > <region name="North America" revenue="149036"/> > > > </month> > > > > > > <month name="Oct-05" revenue="324299" average="64859"> > > > <region name="APAC" revenue="32078"/> > > > <region name="Europe" revenue="85420"/> > > > <region name="Japan" revenue="80483"/> > > > <region name="Latin America" revenue="64390"/> > > > <region name="North America" revenue="61928"/> > > > </month> > > > > > > <month name="Nov-05" revenue="415403" average="83080"> > > > <region name="APAC" revenue="58832"/> > > > <region name="Europe" revenue="143128"/> > > > <region name="Japan" revenue="64295"/> > > > <region name="Latin America" revenue="58261"/> > > > <region name="North America" revenue="90887"/> > > > </month> > > > > > > <month name="Dec-05" revenue="386089" average="77217"> > > > <region name="APAC" revenue="80555"/> > > > <region name="Europe" revenue="118981"/> > > > <region name="Japan" revenue="87520"/> > > > <region name="Latin America" revenue="27154"/> > > > <region name="North America" revenue="71879"/> > > > </month> > > > > > > </list> > > > > > > -- 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/ <*> Your email settings: Individual Email | Traditional <*> To change settings online go to: http://groups.yahoo.com/group/flexcoders/join (Yahoo! ID required) <*> To change settings via email: mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] <*> 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/