RedBoxClipEvent

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.RedBoxClipEvent
File last modified:Wednesday, 04 May 2011, 17:16:07
RedBoxClipEvent is the class representing all events dispatched by the RedBox's AVClipManager instance, except the connection events (see the RedBoxConnectionEvent class).
The RedBoxClipEvent 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
  • CLIP_LIST : String
    • Dispatched when clips list is returned, in response to a AVClipManager.getClipList request.
  • CLIP_RECORDING_STARTED : String
    • Dispatched when the recording af an a/v clip starts, in response to a AVClipManager.startClipRecording request.
  • CLIP_SUBMISSION_FAILED : String
    • Dispatched when an error occurs in the RedBox server-side extension after submitting an a/v clip.
  • CLIP_ADDED : String
    • Dispatched when a new a/v clip has been submitted by one of the users in the current zone.
  • CLIP_DELETED : String
    • Dispatched when an a/v clip has been deleted by one of the users in the current zone.
  • CLIP_UPDATED : String
    • Dispatched when the properties of an a/v clip have been updated by one of the users in the current zone.

Constants

CLIP_ADDED

public static const CLIP_ADDED:String = "onClipAdded"
(read)

Dispatched when a new a/v clip has been submitted by one of the users in the current zone.

The params object contains the following parameters.
Parameters:
clip:
(Clip) the Clip instance representing the added a/v clip.
Example:
  • The following example shows how to handle a clip added event.
    avClipMan.addEventListener(RedBoxClipEvent.CLIP_ADDED, onClipAdded);
    
    function onClipAdded(evt:RedBoxClipEvent):void
    {
        var clip:Clip = evt.params.clip;
    
        trace("A new clip was submitted");
        trace ("Clip id:", clip.id);
        trace ("Clip submitter:", clip.username);
        trace ("Clip size:", clip.size + " bytes");
        trace ("Clip last modified date:", clip.lastModified);
        trace ("Clip properties:");
        for (var s:String in clip.properties)
            trace (s, "-->", clip.properties[s]);
    }

CLIP_DELETED

public static const CLIP_DELETED:String = "onClipDeleted"
(read)

Dispatched when an a/v clip has been deleted by one of the users in the current zone.

The params object contains the following parameters.
Parameters:
clip:
(Clip) the Clip instance representing the deleted a/v clip.
Example:
  • The following example shows how to handle a clip deletion event.
    avClipMan.addEventListener(RedBoxClipEvent.CLIP_DELETED, onClipDeleted);
    
    avClipMan.deleteClip(clipId);
    
    function onClipDeleted(evt:RedBoxClipEvent):void
    {
        trace("The clip " + evt.params.clip.id + " was deleted");
    }

CLIP_LIST

public static const CLIP_LIST:String = "onClipList"
(read)

Dispatched when clips list is returned, in response to a AVClipManager.getClipList request.

The params object contains the following parameters.
Parameters:
clipList:
(Array) a list of Clip objects for the zone logged in by the user.
Example:
  • The following example shows how to request the available clips list.
    avClipMan.addEventListener(RedBoxClipEvent.CLIP_LIST, onClipList);
    
    avClipMan.getClipList();
    
    function onClipList(evt:RedBoxClipEvent):void
    {
        for each (var clip:Clip in evt.params.clipList)
    {
            trace ("Clip id:", clip.id);
            trace ("Clip submitter:", clip.username);
            trace ("Clip size:", clip.size + " bytes");
            trace ("Clip last modified date:", clip.lastModified);
            trace ("Clip properties:");
            for (var s:String in clip.properties)
                trace (s, "-->", clip.properties[s]);
        }
    }

CLIP_RECORDING_STARTED

public static const CLIP_RECORDING_STARTED:String = "onClipRecordingStarted"
(read)

Dispatched when the recording af an a/v clip starts, in response to a AVClipManager.startClipRecording request.

No parameters are provided.
Example:
  • The following example shows how to handle the "onClipRecordingStarted" event.
    avClipMan.addEventListener(RedBoxClipEvent.CLIP_RECORDING_STARTED, onClipRecordingStarted);
    
    avClipMan.startClipRecording(true, true);
    
    function onClipRecordingStarted(evt:RedBoxClipEvent):void
    {
        // Attach camera output to video instance on stage to see what I'm recording
        video.attachCamera(Camera.getCamera());
    }

CLIP_SUBMISSION_FAILED

public static const CLIP_SUBMISSION_FAILED:String = "onClipSubmissionFailed"
(read)

Dispatched when an error occurs in the RedBox server-side extension after submitting an a/v clip.
This event is used when either a recorded or an uploaded clip is submitted.

The params object contains the following parameters.
Parameters:
error:
(String) the error message sent by the RedBox extension.
Example:
  • The following example shows how to handle a clip submission error.
    avClipMan.addEventListener(RedBoxClipEvent.CLIP_SUBMISSION_FAILED, onClipSubmissionFailed);
    
    var clipProperties:Object = {};
    clipProperties.author = "jack";
    
    avClipMan.submitRecordedClip(clipProperties);
    
    function onClipSubmissionFailed(evt:RedBoxClipEvent):void
    {
        trace("An error occurred during clip submission:", evt.params.error);
    }

CLIP_UPDATED

public static const CLIP_UPDATED:String = "onClipUpdated"
(read)

Dispatched when the properties of an a/v clip have been updated by one of the users in the current zone.

The params object contains the following parameters.
Parameters:
clip:
(Clip) the Clip instance representing the updated a/v clip.
Example:
  • The following example shows how to handle an update in clip properties.
    avClipMan.addEventListener(RedBoxClipEvent.CLIP_UPDATED, onClipUpdated);
    
    var newClipProperties:Object = {};
    newClipProperties.title = "Batman - The Dark Knight";
    newClipProperties.author = "Warner Bros.";
    
    avClipMan.updateClipProperties(clipId, newClipProperties);
    
    function onClipUpdated(evt:RedBoxClipEvent):void
    {
        trace("Clip properties have been updated");
        var clip:Clip = evt.params.clip;
    
        // Update the clip list
        ...
    }