Yes. Flex data calls are asynchronous, so you MUST use a handler on the result event. There is no way to "block" the execution of ActionScript.
The same is true of "modal" pop-ups. They only prevent user interaction, they do not block the code execution. Again, you must use an event system. Tracy -----Original Message----- From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Sreejith Unnikrishnan Sent: Friday, July 22, 2005 4:48 PM To: flexcoders@yahoogroups.com Subject: Re: [flexcoders] How to wait for a result from RemoteObject before going further Put the following piece of code in a result function like this function someFunc(myvar) { // var myvar = ecranRO.ajout.result; if (myVar == 1){ do something.... } this.deletePopUp(); } And in the HTTPService tag, add <mx:HTTPService result="someFunc(event.result)" ..... > Sree Ghislain Simard wrote: > Hi, > When in a fonction, how can we wait for the return of a RemoteObject > before executing the next line in the same function? > > function submitForm(){ > ecranRO.ajout.send(); > var myvar = ecranRO.ajout.result; > if (myVar == 1){ > do something.... > } > this.deletePopUp();<mx:HTTPService id="lookup" > > Thanks > > > > > > > -- > 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 > > * Visit your group "flexcoders > <http://groups.yahoo.com/group/flexcoders>" on the web. > > * To unsubscribe from this group, send an email to: > [EMAIL PROTECTED] > <mailto:[EMAIL PROTECTED]> > > * Your use of Yahoo! Groups is subject to the Yahoo! Terms of > Service <http://docs.yahoo.com/info/terms/>. > > > ------------------------------------------------------------------------ > -- 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 -- 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/