Search code examples
phpactionscript-3amfphpserialization

Unserialize in ActionScript 3


I have an array that I am constructing in PHP which I am serializing then returning to Flex through AMFPHP. Can someone point me towards a solution for unserilizing said data once it gets into Flex via ActionScript 3?


Solution

  • There are basically two ways. If you use something like the RemoteObject class, they will be automatically deserialized. This is how I prefer to do things. However, if all you've got is a ByteArray if serialized objects, you can use the read{Object,Int,...} methods to read the data it contains.