2 Replies Latest reply: Mar 6, 2009 11:18 AM by sneakyimp RSS

    Transcoding AMF

    sneakyimp Community Member
      It is my desire to transmit some data encoded in Action Message Format (AMF3) over a socket to and from Flash. I need to know two things:

      1) How to read AMF3 data off a Flash Socket object. I'm assuming it will come through as an array of bytes and that array of bytes must be decoded into actual Actionscript Strings/Arrays/Objects or whatever.

      2) How to turn Actionscript vars into AMF encoded binary strings.

      Surely there is some built-in flash object which can do this? AMFPHP encodes data into AMF for transmission and its Actionscript client code looks like the attached example.

      That code appears to be AS2 and relies on the remoting and rpc classes

      The other example is from Zend_Amf (a framework) that also uses AMF and they offer some AS3 code that uses NetConnection and Responder objects.

      It would appear that these built-in flash primitives are built for Remote Procedure Calls and expect return values to be communicated. I don't see any actual transcoding of objects from/into AMF which is what I really want. Any help would be much appreciated.