Hi!
I try to share instance of a class between two applications but the message receive is just an object and not the instance of the class and when I try to convert it into a class, I get a "null" value.
Here some infos about what I done:
a exemple class:
[Bindable]
[RemoteClass(alias="com.brand.Message")]
public class Message
{
// Some properties
}
I send it with netGroup:
_netGroup.sendToNearest(message, neighbor.address);
So on the other application I receive the Message instance as an Object so I try to convert it to Message:
var message:Message = event.info.message as Message;
But message is "null" when it's done...
So, is it possible to receive automaticly the good object type (here "Message") and, if not, how to convert it?
Thx!!
Ok, I found the solution, it's really simple in fact.
I just need to register my class with registerClassAlias()...
So now the type of my "event.info.message" is "Message". \o/
Yes but NetConnection use AMF so I register my commun class in my applications and they receive the instance I send with NetGroup, no need to use a bytearray.
I need to do more tests with complexe Class but, for now, it works well with my class. I just need to register all classes used in this sended class.
North America
Europe, Middle East and Africa
Asia Pacific