Yes. I typically centralize all of my data within a model. Using the singleton pattern makes this very convenient.
One more option is to use the AsyncToken to make data available in the result handler. Tracy Spratt, Lariat Services, development services available _____ From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of Angelo Anolin Sent: Wednesday, August 26, 2009 2:06 AM To: flexcoders@yahoogroups.com Subject: Re: [flexcoders] Flex Function and Web Service ResultHandler Question Hi Tracy, Thanks for the input. How can I then pass some objects and variables to the ResultHandler which I have made some modifications prior to calling the web service operation? Would my last resort be on declaring variables and objects that would be visible across the whole application? Thanks and regards, Angelo _____ From: Tracy Spratt <tr...@nts3rd.com> To: flexcoders@yahoogroups.com Sent: Wednesday, 26 August, 2009 12:53:31 Subject: RE: [flexcoders] Flex Function and Web Service ResultHandler Question You will have to initiate your "further operations" from the result handler. There is no other way. Tracy Spratt, Lariat Services, development services available _____ From: flexcod...@yahoogro ups.com [mailto: flexcod...@yahoogro ups.com ] On Behalf Of Angelo Anolin Sent: Tuesday, August 25, 2009 9:54 PM To: flexcod...@yahoogro ups.com Subject: [flexcoders] Flex Function and Web Service ResultHandler Question Hi FlexCoders, Needing your input on the following: I have created a function for the dragevent of a list. Code is as follows: private function myFunction(evt: DragEvent) :void { var nameID:String = 'Angelo'; // Call a webservice operation here ws.GetStatus( nameID); Alert.show(String( _xmlGetStatus) , 'myFunction' ); // I need to use the _xmlGetStatus here... // But the _xmlGetStatus is NULL? // Although in the Result Handler, it is not NULL. } private function getStatusResultHand ler(event: ResultEvent) :void { _xmlGetStatus = XML(event.result) ; Alert.show(String( _xmlGetStatus) , 'getStatusResultHan dler'); } The result handler for the GetStatus web service operation populates an XML variable which I declared on top of the script (i.e. private var _xmlGetStatus: XML;). When I run my application, myFunction executes but the alert that is shown first is the one in the function myFunction, instead of the one in the result handler. I need to use the values in the XML variable _xmlGetStatus for further operations in function myFunction, but then the value is not populated right away. Any way to handle this? Thanks and regards, Angelo