Maintaining Nested Object Data Type From Remote Calls

UPDATE registerClassAlias() see below!

This is tripping me out now. On our current project all responses from a remoting call to ColdFusion return custom Value Objects maintaining their data type fine, however, nested VO’s do not maintain their data type and are returned as plain ol’ Objects???

To over come this we create an instance of the vo in the class handling the remoting response which does fix this problem but I am not keen on having to do this i.e.

var t1 : CustomVO            = new CustomVO();

Also I have tried:


Which looked promising but did not work at all?

Any one have any tips on how to handle this issue or at least shed some further insight?

UPDATE Thanks to Peter Lorent who was a star and twittered me reminding me about registerClassAlias(). Now, I must justify myself here and state that yes I had tried this but to no avail. However, as it is with these things most often I tried again and it worked. The reason I most likely believe it failed was an error on my behalf, probably I had the RemoteClass mapping cockeyed or something who knows, the point is this is what you need to do:

registerClassAlias("com.newtriks.model.vo.CustomVO", CustomVO);