Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

111 lines (58 sloc) 6.085 kB

eAMF

eAMF provides Action Message Format (AMF) support for Erlang, compatible with Adobe's Flash Player

Note: this library is a work in progress and not ready for use yet see the Issues Page for current bugs and planned featuers

Action Message Format (AMF)

Action Message Format is a compact binary format that is used to serialize ActionScript object graphs. Once serialized an AMF encoded object graph may be used to persist and retrieve the public state of an application across sessions or allow two endpoints to communicate through the exchange of strongly typed data.

Features

eAMF currently supports AMF3 (Specification) and provides two main features

Serialization: amf3:encode/1 function can be used to convert Erlang terms to binary AMF3 encoded data
De-Serialization: amf3:decode/1 function can be used to convert binary AMF3 encoded data to Erlang terms

Types

undefined

Actionscript's undefined value corresponds to Erlang atom undefined


null

Actionscript's null value corresponds to Erlang atom null


Boolean

Actionscript's Boolean type corresponds to bool() in Erlang which is essentially the atoms true and false


Number

  • All integer values in Actionscript from -268435456 to 268435455, regardless of the type of variable they are stored in - int, uint or Number correspond to an integer() value in Erlang

  • All integer values in Actionscript from -1.79e308 to -268435457 and from 268435456 to 1.79e308, regardless of the type of variable they are stored in - int, uint or Number correspond to float() in Erlang

  • All floating point values in Actionscript correspond to float() in Erlang

  • Actionscript’s Infinity value corresponds to Erlang atom infinity

  • Actionscript’s -Infinity value corresponds to Erlang atom '-infinity'

  • Actionscript’s NaN value corresponds to Erlang atom nan


String

An Actionscript String corresponds to a binary() string in Erlang.

Note: eAMF deals with Erlang strings in binary form eg. <<"hello world">> and not as a List eg. "hello world". Passing the amf3:encode/1 a List will result in an Actionscript Array and not an Actionscript String


XML

Actionscript's XML type corresponds to an Erlang tuple of the form {xml, XMLString}, where XMLString is the xml represented as a string in binary() form.


XMLDocument

Actionscript's XMLDocument type corresponds to an Erlang tuple of the form {xmldoc, XMLDocString}, where XMLDocString is the xml represented as a string in binary() form.


Date

Actionscript's Date type corresponds to an Erlang tuple of the form {date, Milliseconds}, where Milliseconds is the time in milliseconds that has elapsed since midnight January 1, 1970, universal time (UTC)


Array

An Actionscript Array corresponds to an Erlang list()


Object

An Actionscript Object corresponds to an Erlang tuple of the form {object, ClassName, Members} where ClassName is a string in binary() form that represents the class name of this object and Members is a dictionary() where property names are keys


ByteArray

Actionscript's ByteArray type corresponds to an Erlang tuple of the form {bytearray, Bytes}, where Bytes is binary()

Examples

eAMF has a comprehensive set of unit tests, looking at them would help - see here

LICENSE

eAMF is licensed under the MIT License (see LICENSE file for more details)

Jump to Line
Something went wrong with that request. Please try again.