Data service calls are asynchronous.

You need to define a resultHandler function, and call it from the result event of the operation.

Below is a bit of an example, and here is a link to a full example.
http://www.cflex.net/showfaq.cfm?ChannelID=1&faqType=#Question372
http://www.cflex.net/showfiledetails.cfm?ChannelID=1&Object=File&objectID=18
Tracy

<mx:Operation name="ReportJob" result="onResult(event)"/>
 
private function onResult(oEvent:Object):Void
{
    alert(oEvent.result);
}

 

 


From: [email protected] [mailto:[email protected]] On Behalf Of Jeff Steiner
Sent: Thursday, June 16, 2005 11:15 PM
To: [email protected]
Subject: RE: [flexcoders] Re: Assigning a AS variable to the return value of a web service

 

myString = event.result.message;

 

Give that a try.

 

Jeff

Founder

Flex Authority

http://www.flexauthority.com

 

We are actively seeking contributors for the site.  Have a sample that you want to share with the world?  Send it to us!


From: [email protected] [mailto:[email protected]] On Behalf Of gotjosh819i
Sent: Thursday, June 16, 2005 10:39 AM
To: [email protected]
Subject: [flexcoders] Re: Assigning a AS variable to the return value of a web service

 

thanks good info to know.

However it doesnt answer my question to how I put a web service
return (which happens to be only a yes or no) and assign it to a
action script variable.

Any ideas on that one?










--- In [email protected], "Brian Deitte" <[EMAIL PROTECTED]>
wrote:
> You need to put statements in functions (Waldo's article on this
grabbed
> from google since the site isn't returning for me):
>
> http://64.233.187.104/search?
q=cache:7i7Ah65NYooJ:www.waldosmeets.com/in
> dex.cfm%3FentryID%3D550+flex+%22not+permitted+in+a+class+definition%
22&h
> l=en
>
> -Brian
>
> -----Original Message-----
> From: [email protected]
[mailto:[email protected]] On
> Behalf Of gotjosh819i
> Sent: Thursday, June 16, 2005 12:37 PM
> To: [email protected]
> Subject: [flexcoders] Assigning a AS variable to the return value
of a
> web service
>
> help please:
>
> new at AS 2,
>
> How do I assign a return from a WS to a AS variable.
>
> Example here is what I have so far and its erroring out.
>
> 1 Error found.

> Error /gvs/gvsStartB.mxml:21
> This statement is not permitted in a class definition.
>
>
>
> <mx:WebService wsdl="http://blahblah/_cfc/gvs_reports.cfc?wsdl"
> id="gvsJob">
>         <mx:operation name="ReportJob" />        
> </mx:WebService>
>
>
> <mx:Script>
>       <![CDATA[
>              var JobRunning:Object = ReportJob.DataAvailable.result;
>       ]]>
>        
>         //Checks to see if database Jobs are running, if they are
> not it will
>         //say available = yes, if they are it will say available =
> no
>         if (JobRunning == "No")
>         {
>               someactions       
>           }
> </mx:Script>
>
>
>
>
>
>

> Yahoo! Groups Links


 



Yahoo! Groups Links

Reply via email to