# Flash Remoting, OpenAMF and J2EE

**URL:** <https://forum.kirupa.com/t/flash-remoting-openamf-and-j2ee/168823>\
**Category:** programming\
**Created:** [November 10, 2005, 11:42am UTC](https://forum.kirupa.com/t/flash-remoting-openamf-and-j2ee/168823 "2005-11-10T11:42:10Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![hybrid\_ProgArte](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/hybrid_progarte/32/1910_2.png) [@hybrid\_ProgArte](https://forum.kirupa.com/u/hybrid_ProgArte)\
**Post date:** [November 10, 2005, 11:42am UTC](https://forum.kirupa.com/t/flash-remoting-openamf-and-j2ee/168823/1 "2005-11-10T11:42:10Z")

</div>

[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…than](mailto:image.gif@gmail.com...than)ks 🙂
