Found it out myself!

Before serializing the instance you have to register the class with an alias. Than everything is perfect.

Like so:

 

flash.net.registerClassAlias("de.benz.test",Test);

var customClass:Test=new Test();

customClass.test="hallo";

out.text+="\n"+typeof customClass;

byteObj.writeObject(customClass);

 

socket.writeBytes( byteObj );

socket.flush();

 

 

cooolllll!

 

 

 

 


Von: [email protected] [mailto:[EMAIL PROTECTED] Im Auftrag von Benjamin Dobler
Gesendet: Dienstag, 29. August 2006 20:39
An: [email protected]
Betreff: [flexcoders] ByteArray - Custom Class

 

Hi,

 

i started playing with the Socket Class and Byte Arrays. So far i`ve a Java Socket Server that sends all the Byte Data back to all listening clients.

One client sends for example an array. This comes perfectly back too all connected clients. All the data is still intact and i can easily find out about the
type of the object by using typeof. This only seems to work for primitive types. All other types become type Object. Is there a way to find out with which class an Object belongs
when it was converted to an byte array? I think it should be possible because it`s all amf. Any ideas?

 

Thanx

 

Benz

__._,_.___

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