|
Nope, an instance must actually be of a particular type in
order to coerce it to that type.
Try adding metadata to your class:
[RemoteClass(alias="TestVO")]
public class TestVO
{
}
The MXML compiler will generate the correct code to
register an alias for the TestVO class as "TestVO" and thus create actual
instances of TestVO on deserializing a response.
Also note that the as operator does not throw an exception
if the instance is not of the correct type - instead it will just return null.
If you want an exception you need to use casting syntax:
var typeCastTry:TestVO =
TestVO(RETURN_OBJ);
Pete From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of mdoberenz Sent: Monday, October 23, 2006 10:41 AM To: [email protected] Subject: [flexcoders] Typecast a generic Object into a VO
-- 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
Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required) Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe __,_._,___ |
- Re: [flexcoders] Typecast a generic Object into a VO Darron J. Schall
- RE: [flexcoders] Typecast a generic Object into a ... Peter Farland
- Re: [flexcoders] Typecast a generic Object into a ... Tom Chiverton
- Re: [flexcoders] Typecast a generic Object into a ... Sebastian Zarzycki
- Re: [flexcoders] Typecast a generic Object into a ... Mark Doberenz
- RE: [flexcoders] Typecast a generic Object int... Peter Farland

