I tried that but it returns an empty ArrayCollection because it's only created within the ResultEvent Function once the HTTPService is successful...
Thanks. ________________________________ From: valdhor <[email protected]> To: [email protected] Sent: Wednesday, April 8, 2009 11:20:44 AM Subject: [flexcoders] Re: How can I have my class return an ArrayCollection? Umm.. Add a public function that returns serviceArray ? --- In flexcod...@yahoogro ups.com, "sailorsea21" <sailorsea21@ ...> wrote: > > Hi everyone, > how can I have this following class return me an ArrayCollection whenever I > call it???? > > [Bindable] > public class Services > { > public var serviceArray: ArrayCollection; > public var serviceXML:XML; > > public function getServices( ):void > { > var service:HTTPService = new HTTPService( ); > service.url = "test.php"; > service.useProxy = false; > service.method = "POST"; > service.resultForma t = "e4x"; > service.showBusyCur sor = true; > service.addEventLis tener(ResultEven t.RESULT, > function (event:ResultEvent) :void > { > serviceArray = new ArrayCollection( ); > serviceXML = event.result as XML; > var ourxml:XML; > for each(ourxml in serviceXML.elements ()) serviceArray. addItem(ourxml) ; > } > ); > service.send( ); > } > } >

