Namespace: playerio
Language: ActionScript 3
Allows the client to connect to the Multiplayer servers
Properties | |||
|---|---|---|---|
| public |
Returns the connection's connected status |
||
Methods | |||
| public |
Listen to server disconnects. This method is only called if we are disconnected by the server. A call to connection.disconnect will not trigger this method. |
||
| public |
Add listener for messages of a specified type |
||
| public |
Creates a Message instance |
||
| public |
Disconnects from the server |
||
| public |
Removes a handler previously attached with addDisconnectHandler |
||
| public |
Removes a message handler previously attached with addMessageHandler |
||
| public |
Quick way to send messages to the server |
||
| public |
Sends a message to the server |
||
Returns the connection's connected status
Listen to server disconnects. This method is only called if we are disconnected by the server. A call to connection.disconnect will not trigger this method.
| Function | handler |
| Callback to execute if disconnected from the server. |
Add listener for messages of a specified type
| String | type |
| String that defines what type to listen to. If sat to " the listener will listen to all message types | |
| Function | handler |
| Callback method executed when a message of the type specified is recived: function(m:Message):void{...} or function(m:Message, messageValye1:Type, messageValye1:Typ, ... ):void{...} |
Shows how to define a message listener
Shows how to define a message listener with inline arguments
Creates a Message instance
| String | type |
| The type of the message | |
| params restParam | args |
| Data entries we should add to the message when we create it |
| playerio:Message | |
Disconnects from the server
Removes a handler previously attached with addDisconnectHandler
| Function | handler |
| Callback we wish to remove the listener for. |
Removes a message handler previously attached with addMessageHandler
| String | type |
| String that defines what type we wish to stop listening to | |
| Function | handler |
| Callback we wish to remove the listener for |
Quick way to send messages to the server
| String | type |
| The type of the message we want to send | |
| params restParam | args |
| Data entries that should be added to the message |
Sends a message to the server
| playerio:Message | message |
| Message to send to the server |