Reputation: 462
How can i decode AMF3 Object in Flex. We have a python Socket server which encodes data as AMF3.
We already deserialize data in Android Client but cant find a good way to do that in Flex.
Take a look how we are doing Java for Android client.
String res = res.substring(1);
InputStream in = new ByteArrayInputStream(res.getBytes());
DataInputStream dis = new DataInputStream(in);
AMF3Deserializer amf = new AMF3Deserializer(dis);
Object o = null;
try {
o = amf.readObject();
} catch (IOException e) {
e.printStackTrace();
}
Map map = (HashMap)o;
Object[] ob = (Object[]) map.get("result_set");
Object[] obn = (Object[]) ob[0];
Upvotes: 1
Views: 640
Reputation: 21
incase there are new searchers for this topic,
in AS3, use flash.net.Socket.readObject()
method. It will automaticaly read the object as AMF format
Upvotes: 2
Reputation: 39408
Why wouldn't you use a RemoteObject to make your calls to the server? Then deserialization is handled automatically for you.
Did you write your own AMF serialization / deserialization methods on the server? Or did you use something like PythonAMF?
Upvotes: 0