Aejaz,
 
This is expected.
 
You can't assign the result of a remote object call immediately to a value. The Flash Player needs to make calls asynchronously so that the movie does not stall while waiting for a response from the network. Instead you're returned a token to help you track results from asynchronous invocations. This is called the Asynchronous Completion Token (ACT) pattern. You need to have a result handler registered for your RemoteObject (or individual operation, or individual invocation on the token itself). When the result event is raised, your handler will get a ResultEvent which will have the Array result (as well as access to the ACT token.
 
Pete


From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of aejaz_98
Sent: Sunday, June 11, 2006 6:00 AM
To: [email protected]
Subject: [flexcoders] Flex2B3: Problem returning Object[] from a RemoteObject call

Hi,

I am calling a java method on server side which returns
an array of type Object[]. On the client side I do the
following,

var arr:Array = remoteObject.call();

Doing this gives me an exception which says,

TypeError: Error #1034: Type Coercion failed: cannot convert mx.rpc::[EMAIL PROTECTED] to Array.

After changing the type of arr to AsyncToken ,I do see that
there is a result field in the AsyncToken object which was
returned but that too is null. What is the significance of
the AsyncToken object here ?

According to the Flex Developer's guide(page 1154), I would have
got an Array as the result of the call. Please let me know what am
I doing wrong.

Thanks,
Aejaz

__._,_.___

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com





SPONSORED LINKS
Web site design development Computer software development Software design and development
Macromedia flex Software development best practice


YAHOO! GROUPS LINKS




__,_._,___

Reply via email to