Home : Adobe : Flash : Video : Cuepoints

Cue Points in Flash Video

From version 8, Flash FLV video files support the use of cue points. Cue points are invisible markers in a video file which can be used to trigger external events such as:

Creating Cue Points

There are two ways to create cue points.

(1) Embed cue points in the video file when you encode it. This creates permanent cue points.

In the Flash Video Encoder, click the Settings button, then click the Show Advanced Settings button, then click the Cue Points tab.

(2) Create cue points dynamically. This means you can add cue points to a video file at runtime, even if the file itself has no embedded cue points. These are temporary cue points and do not become part of the video file.

When using an FLVPlayback component, open the Component Inspector and double-click the value cell of the cuePoints parameter. This opens the Cue Points dialog box, where you can enter the desired cue points and times.

How Cue Points Work

Cue points don't do anything by themselves — they are only passive markers. To make use of cue points you need to write some Actionscript in the SWF file which contains the video file. The Actionscript code "listens" for cue points and takes whatever action you specify when it encounters one.

The following Actionscript code shows how this can work. This example refers to an FLVPlayback component with the instance name "my_FLVPlybk".

var listenerObject:Object = new Object();
listenerObject.cuePoint = function(eventObject:Object):Void {
	// Put any code you like here
	trace("Cue point name: " + eventObject.info.name);
	trace("Cue point type: " + eventObject.info.type);
}
my_FLVPlybk.addEventListener("cuePoint", listenerObject);
Subscribe to us on YouTube