Awesome. This works. Thanks. I don't know what going on here, but here is the code that I used to loop thru. I'm assuming that the HTTPService event is pulled in as an ArrayCollection if more than one record is returned.
********CODE*********** import mx.collections.*; import mx.controls.Alert; public function afterSend():void { var a:Array; if(HTTPService.lastResult.CircSec.CircuitID is ArrayCollection) { a = HTTPService.lastResult.CircSec.CircuitID.source; }else{ a = [HTTPService.lastResult.CircSec.CircuitID]; } for (var i:int = 0; i < a.length; i++) { Alert.show (a[i].FromBusName); } } *********END OF CODE**************** --- In flexcoders@yahoogroups.com, "Pan Troglodytes" <[EMAIL PROTECTED]> wrote: > > I'm not exactly sure where you're running into the problem, as I don't use > toArray. But here's how I solved the whole one result/multiple results > problems, translated to use your terms: > > var a:Array; > if (httpservice.lastResult.CircSec.CircuitID is ArrayCollection) > a = httpservice.lastResult.CircSec.CircuitID.source > else > a = [httpservice.lastResult.CircSec.CircuitID]; > > Hope that helps. > > > On 7/10/06, meathead <[EMAIL PROTECTED]> wrote: > > > > Hi all and thanks in advance, > > > > I have a combo box that fires off an HTTPService based on results > > from selection. From this HTTPService, I want to make a new pane > > for each record returned in an accordion. I was returning correct > > answers for multiple records, but not for results that numbered in > > one. Then I saw the mx.utils.ArrayUtil.toArray() thing and now I > > can only return results that number in one and not multiple. > > > > Question #1: Is this a good route to follow if I want to > > dynamically want to fill the panes of an accordion based on results > > from a query via XML. Or should I scrap and do something cooler. > > > > Question #2: This only returns answers for conditions when one > > record is returned. How do I get it to work with multiple answers? > > I'm thinking this has something to do with it not grabbing the > > correct length in the for loop. > > > > Here is some code. > > > > <mx:Script> > > <![CDATA[ > > import mx.collections.*; > > import mx.controls.Alert; > > import mx.utils.ArrayUtil; > > [Bindable] > > public var resultArray:ArrayCollection; > > public function afterSend():void > > { > > var arrData:Array = new Array; > > arrData = mx.utils.ArrayUtil.toArray > > (event.lastResult.CircSec.CircuitID); > > > > for (var i:int = 0; i < arrData.length; i++) { > > Alert.show (arrData[i].FromBusName); > > } > > > > } > > > > Thanks again, > > Aaron > > > > > > > > > > -- > Jason > -- 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/