Events Overview
Data for the following events are embedded by Captionate 2: About NetStream.time value
Due to playback latency, the NetStream.time value received at the events may differ slightly from the actual timestamp of the markers/captions/cue points. Also, NetStream.time will only return a time value if a tag exists in the FLV at that time. One way to compensate for latency is by using the Tweak Times Dialog.
 
About the sample code
Sample code for events assumes the following initial setup code (to play an FLV file) is used.
 
The sample code for events (same for AS1/AS2 and AS3), defines functions for client object, and events will be handled there.
 
Here's the sample AS1/AS2 code for playing a local FLV (named 'sample.flv'):
// Required: a Video symbol with instance name "video" on Stage

/* Create it using the New Video... command in the context menu of Library panel,
   make sure you choose 'ActionScript' option.
   Drag the new symbol from Library to Stage.
   Set the instance name to 'video'  */

//Create a NetConnection object
var nc = new NetConnection();
nc.connect(null);
//Create a NetStream object
var ns = new NetStream(nc);
video.attachVideo(ns);
//In AS2, the client is the NetStream
var client = ns;
//Play using NetStream
ns.play("sample.flv");
Here's the sample AS3 code for playing a local FLV (named 'sample.flv'):
//Create new Video (Alternatively, you can do it as described in AS1/AS2 code above)
var video = new Video();
addChild(video);
//Create a NetConnection object
var nc = new NetConnection();
nc.connect(null);
//Create a NetStream object
var ns = new NetStream(nc);
video.attachNetStream(ns);
//In AS3, the client is a property of NetStream
ns.client = new Object();
var client = ns.client;
//Play using NetStream
ns.play("sample.flv");

 
Online URL for this page is http://www.buraks.com/captionate/help/en/index.html?p=e0.html