View comments | RSS feed

Listening for cuePoint events

The cuePoint event allows you to receive control in your ActionScript code when a cuePoint event occurs. When cue points occur in the following example, the cuePoint listener calls an event handler function that displays the value of the playheadTime property and the name and type of the cue point.

my_FLVPlybk.addEventListener(MetadataEvent.CUE_POINT, cp_listener);
function cp_listener(eventObject:MetadataEvent):void {
        trace("Elapsed time in seconds: " + my_FLVPlybk.playheadTime);
        trace("Cue point name is: " + eventObject.info.name);
        trace("Cue point type is: " + eventObject.info.type);
}

For more information on the cuePoint event, see the FLVPlayback.cuePoint event in the ActionScript 3.0 Language and Components Reference.


Flash CS3

Take a survey


Comments


No screen name said on Jul 24, 2007 at 1:36 AM :
This code snippet does not work on it's own, because the MetadataEvent class is by default unknown to the compiler, and will throw an error 1046:
(class) Type was not found or was not a compile-time constant: MetadataEvent.

The solution is to import this class first with the code line\

import fl.video.MetadataEvent;
extdw_doc said on Oct 1, 2007 at 3:25 PM :
Even with the import statement the snippet would not do anything on its own because there is no FLV to trigger the event. This snippet is an extension of the example on the previous page, Adding ActionScript cue points. In conjunction with that example, this snippet will trace the cue points
as they occur. Note that an FLVPlayback instance with the name my_FLVPlybk is required. Also, the import statement for MetadataEvent is present in that part of the example.
ced_damoo said on Aug 14, 2008 at 11:45 PM :
Does anyone as problem with event cue points embeded in video ?

I don't get them from the listener although I get the AS cue point and the embed NAV cue points

 

RSS feed | Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/flash/9.0/main/00000565.html