I make a remote call to a method defined on my Java back end (using BlazeDS). This method returns a MyType object. On the Flex side the return value is of course wrapped inside a ResultEvent object and stored as an Object. The debugger clearly shows that the ResultEvent contains a MyType in its result field. So naturally you'd expect that I could cast the result from an Object to a MyType but the result of doing so is null. Here is some code to illustrate what happens...
private function scenarioLoadedHandler(event:ResultEvent):void {
var result:Object = event.result;
//willCastWork is false
var illCastWork:Boolean = (result is MyType);
//myType is null
var myType:MyType = result as MyType; }
Remember the debugger clearly shows that result is of type "MyType" but the casting fails, any ideas why this may happen?