I'm having a problem passing objects that contain objects through the AMF gateway.  I've found a way to work around it, but I'm not really keen on the solution.  What I'm trying to do is pass an object to a java function.  This object contains a reference to another object within it.  When trying to access methods on the object that is referenced I get a java exception.

Here is some example flex code that doesn't work:

var myObject:MyObject = new MyObject();
var subObject:SubObject = new SubObject();
myObject.sub = subObject;
service.myFunction(myObject);

Here is my workaround:

var myObject:MyObject = new MyObject();
var subObject:SubObject = new SubObject();
myObject.sub = new SubObject();
myObject.sub.vara = subObject.vara;
myObject.sub.varb = subObject.varb;
...
service.myFunction (myObject);


I'd rather not have to manually create an object on the object and then manually copy over each of the variables.  Is there a better way around this?  Perhaps a setting on the RemoteObject?


--Josh

__._,_.___

--
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