RedBoxConnectionEvent

Kind of class:public class
Package:com.smartfoxserver.v2.redbox.events
Inherits from:SFSEvent
Dispatched by:
Author:The gotoAndPlay() Team
http://www.smartfoxserver.com
Classpath:com.smartfoxserver.v2.redbox.events.RedBoxConnectionEvent
File last modified:Wednesday, 04 May 2011, 17:26:40
RedBoxConnectionEvent is the class representing all connection-related events dispatched by the RedBox managers (AVChatManager, AVCastManager and AVClipManager).
The RedBoxConnectionEvent extends the SFSEvent class, which provides a public property called params of type Object containing event-related parameters.
Usage:
  • Please refer to the specific events for usage examples and params object content.

Summary


Constants

Constants

AV_CONNECTION_ERROR

public static const AV_CONNECTION_ERROR:String = "onAVConnectionError"
(read)

Dispatched when the connection to Red5 server can't be established.
This event is dispatched when an error or special condition (like "connection closed") occurred in the flash.net.NetConnection object used internally by the used RedBox manager to handle the connection to Red5.
This kind of error is always related to the Red5 server connection, so you should check if the server is running and reachable.
Also check the Red5 logs or console output for more details.
NOTE: when a connection error occurs, all the existing chat sessions (whatever their status is) are stopped.

The params object contains the following parameters.
Parameters:
errorCode:
(String) the description of the error condition; check the "code" property of the NetStatusEvent.info object in the ActionScript 3 Language Reference.
Example:
  • The following example shows how to handle a Red5 connection error.
    avChatMan.addEventListener(RedBoxChatEvent.AV_CONNECTION_ERROR, onAVConnectionError);
    
    function onAVConnectionError(evt:RedBoxChatEvent):void
    {
        trace("A connection error occurred: " + evt.params.errorCode);
    }

AV_CONNECTION_INITIALIZED

public static const AV_CONNECTION_INITIALIZED:String = "onAVConnectionInited"
(read)

Dispatched when the connection to Red5 server has been established.
This event is dispatched after the used RedBox manager is instantiated, or when its initAVConnection method is called.
The connection to Red5 must be available before any method related to a/v streaming is called.

No parameters are provided.
Example:
  • The following example shows how to handle the "onAVConnectionInited" event.
    var red5IpAddress:String = "127.0.0.1";
    var avChatMan:AVChatManager = new AVChatManager(smartFox, red5IpAddress);
    
    avChatMan.addEventListener(RedBoxChatEvent.AV_CONNECTION_INITIALIZED, onAVConnectionInited);
    
    function onAVConnectionInited(evt:RedBoxChatEvent):void
    {
        trace("Connection to Red5 established");
    }