Can you show me the constructor of your ActionScript UserVO class? Note that ActionScript object instantiation from deserialized AMF is different from, say, normal Java object instantiation.
i.e. The ActionScript pseudo code might look something like this (note, I'm not an AS coder and this isn't real ActionScript... just a reflection of my understanding of what goes on): var myInstance:MyType = MyType.prototype.clone(); myInstance.someProperty = suppliedValue; myInstance.anotherProperty = anotherSuppliedValue; ... myInstance.constructor(); This allows you to mimic passing constructor arguments. If you set defaults in your constructor then you should first check to see if a property is undefined so that you don't override the deserialized value. -----Original Message----- From: Jeff Krueger [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 05, 2005 4:56 PM To: flexcoders@yahoogroups.com Subject: RE: [flexcoders] Remote object that returns an array of objects I use the UserVO within script in the application, not in the exact script, but in other places. I was doing an alert with the typeof function. I don't have a function but I do have lots of public vars which come back undefined. So I assume they were not of the proper type. I think I have a test case that should prove the class is available but I am not sure. I am using the cairngorm framework. So in my command class in the onResult class I can test these two sets of code. Obviously I switch out the java code to return the correct types to match the test. Test 1 (Fails, but I do get the correct length array of 1 item) var tempArray:Array = Array (event.result); for (var i = 0; i<tempArray.length; i++) { var tempUser:UserVO = UserVO(tempArray[i]); mx.core.Application.alert ("Test with userVo " + tempUser.userName); } Test 2 (Succeeds) var temp:UserArrayVO = UserArrayVO (event.result); var tempUser:UserVO = UserVO(temp.userArray[0]); mx.core.Application.alert ("Test2 with userVo " + tempUser.userName); Does that test make any sense or prove or disprove anything? Thanks Jeff -----Original Message----- From: Peter Farland [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 05, 2005 2:15 PM To: flexcoders@yahoogroups.com Subject: RE: [flexcoders] Remote object that returns an array of objects [snip] Info: Serializing response (Message #0 targetURI=/2/onResult, responseURI=null) (Array #0) [0] = (Typed Object #1 'net.crownmedia.flex.user.vo.UserVO') [/snip] The AMF trace says objects are being sent back as Typed AMF Objects in both cases... so now you have to determine whether the type is linked in at compile time (this will depend on more than just an import statement - you actually have to use the type somewhere in the script) so that it is available at runtime. When you said "the items inside the array are of type object" how are you determining that they are just a plain old ActionScript object? Note that typeof() in AS2 does not tell you the class name of an instance, it always says object for anything that is derived from object. Do you have a function on your ActionScript UserVO class that you can call to check whether it was correctly instantiated as UserVO? Yahoo! Groups Links Yahoo! Groups Links Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/