2 Replies Latest reply on Dec 21, 2007 2:42 AM by Greg Dove

    Object Serialization

    morxy
      Can you serialize Flash objects in ActionScript 2 / Flash Player 8, then send them to a server program using LoadVars? If so, are objects serialized to XML or a binary string such as AMF?

      Mark
        • 1. Re: Object Serialization
          Level 7
          Yes, you can do it any way you like...as in there's no built in
          serialization method. You have some object with properties and values, and
          you can make it into XML, plain text, or... You can just send the object
          with remoting, (AMF) and PHP would receive an associative array... whatever
          works.

          --
          Dave -
          Head Developer
          http://www.blurredistinction.com
          Adobe Community Expert
          http://www.adobe.com/communities/experts/


          • 2. Re: Object Serialization
            Greg Dove Level 4
            Like Dave said you can do it how you like. But just to clarify you wouldn't use LoadVars to send amf or XML serialized data. LoadVars is mainly for urlencoded data -like a html form submission -and there's no way you can use it to send direct binary data (not directly anyway-you could send it as base64 encoded). Its also possible to use LoadVars to send json encoded data with a few tweaks which you can decode on the server to the equivalent complex objects - e.g. using json_decode in php. But for greater flexibility you would generally benefit from using remoting, like Dave said. It does all the hard work for you.