0
Transcoding AMF
Contributor
,
/t5/animate-discussions/transcoding-amf/td-p/811885
Mar 05, 2009
Mar 05, 2009
Copy link to clipboard
Copied
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.
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.
TOPICS
ActionScript
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Guru
,
/t5/animate-discussions/transcoding-amf/m-p/811886#M17970
Mar 05, 2009
Mar 05, 2009
Copy link to clipboard
Copied
Responses to amf calls get decoded into native objects
automatically. AMFPHP has as3/amf3 suport as well in recent
versions.
But you can also do your own encoding in actionscript.
Check out the ByteArray class.
You can set the amf encoding version and use writeObject() to encode.
Encoding is either amf0 (as1 and as2) or amf3 (as3) version
But you can also do your own encoding in actionscript.
Check out the ByteArray class.
You can set the amf encoding version and use writeObject() to encode.
Encoding is either amf0 (as1 and as2) or amf3 (as3) version
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
sneakyimp
AUTHOR
Contributor
,
LATEST
/t5/animate-discussions/transcoding-amf/m-p/811887#M17971
Mar 06, 2009
Mar 06, 2009
Copy link to clipboard
Copied
thanks so much!
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

