Player.IO

Build fun, powerful & scalable online and mobile games with the reliable backend your users expect

Sign Up | Sign In

ActionScript3 Reference

actionscript 3 Message class informationClass Message

Namespace: playerio
Language: ActionScript 3

Message object either sent or received from the server

Properties

 
public
length :int [read-only]

Gets the length of the message

public
type :String

The type of the message

Methods

 
public
add (... args):void

Adds data entry to the Message object

public
getBoolean (index:int):Boolean

Reads a Boolean from the message object at index

public
getByteArray (index:int):flash.utils:ByteArray

Reads a ByteArray from the message object at index

public
getInt (index:int):int

Reads an int from the message object at index

public
getNumber (index:int):Number

Reads a number from the message object at index

public
getString (index:int):String

Reads a String from the message object at index

public
getUInt (index:int):uint

Reads an uint from the message object at index

public
toString ():String

Shows a human readable serialization of the message

length

Gets the length of the message

Return Value

type

The type of the message

Return Value

add

Adds data entry to the Message object

Arguments

params restParam args
Entries to add. Valid types are Number, int, uint, String, Boolean and ByteArray

Example

How to add values to a message

getBoolean

Reads a Boolean from the message object at index

Arguments

int index
The index of the value to be read

Return Value

Boolean

getByteArray

Reads a ByteArray from the message object at index

Arguments

int index
The index of the value to be read

Return Value

flash.utils:ByteArray

getInt

Reads an int from the message object at index

Arguments

int index
The index of the value to be read

Return Value

int

getNumber

Reads a number from the message object at index

Arguments

int index
The index of the value to be read

Return Value

Number

getString

Reads a String from the message object at index

Arguments

int index
The index of the value to be read

Return Value

String

getUInt

Reads an uint from the message object at index

Arguments

int index
The index of the value to be read

Return Value

uint

toString

Shows a human readable serialization of the message

Return Value

String