Flash Remoting, OpenAMF and J2EE

[color=Red]Problem Regarding Typecasting .Java class to .AS class[/color]

Hello, I am a J2EE Programmer and am also doing actionscripting in Flash MX, specifically Remoting. I am using OpenAMF as an opensource alternative for Macromedia’s proprietary Flash Remoting MX.

I already have tried Flash to “talk” to Java but I have some problems regarding typecasting from a .java object to a .as custom class. Here are the details:

I have my custom Person.as class in Flash and Person.java class in Java. Another class in Flash called example2.as uses my Person.as as a variable.
example2.as has a getPerson() method which remotely calls Messenger.java’s getPerson() method. Messenger.java’s getPerson() method returns an instance of my Person.java class which has 2 properties in it,namely firstName and lastName (both Strings). As i can see it in my NetDebugger panel in Flash, Java is throwing to Flash the right object which is a Person.java class with right properties in it, firstName and lastName.
The problem is that i cannot get the properties of Person.java when i typecast it to Person.as class in Flash.
The following things i’ve done before trying to typecast Person.java to Person.as:
**[color=SeaGreen]

  1. made a custom-class-mapping for my Person.as to Person.java as defined in my openamf-config.xml
  2. registered my Person.as class using Object.registerClass() in Flash[/color]**

. . .#2 is done to make Flash understand that a Person.java class is to be deserialized to Person.as class, that is what I think so. Please correct me if i’m wrong. What i need to do is to correcly typecast Person.java class to Person.as class so that i can extract the Person’s properties, namely firstName and lastName.

Anybody who knows this more is free to address his/her insight.

thanks a lot…:book::thumb:

you may also email me at image.gif@gmail.com…thanks :slight_smile: