Hi Tracy, You mentioned that this is the only way...
But doesn't this kind of programming limits what the developer could actually do? I mean for example, you have coded in the dragDrop event of a list control. In the said event, you need to get some data through a web service. The whole operation is dependent on the event handler for the dragdrop. If you would only be allowed to process the operations further in the result handler of the web service, how could you then utilize the event which was the parameter in your dragdrop event? I think this question also goes the same for the Alert.show function where the result handler deviates from the function/event with which it was executed. If the continuation of execution would be on the Alert handler, it would be quite tedious on the part of the developer to be able to gather the variables/objects/handlers from the original function/event. I am pretty sure Adobe / Flex team has thought about this but I may be doing things wrong. So I would appreciate everyone's input. I am in a bind right now cause this limitation(?) hampers me from being a lot more productive with Flex. Thanks. Angelo ________________________________ From: Tracy Spratt <tr...@nts3rd.com> To: flexcoders@yahoogroups.com Sent: Wednesday, 26 August, 2009 12:55:18 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