Working with Video Cue Points in Flash Professional 8

 

Cue points can be inserted directly into your Flash video (FLV) files to accomplish a variety of tasks. This article shows you how to work with video cue points and use them with ActionScript to add powerful seek functionality to a playback interface.

Cue points are established points, or markers, that can be embedded directly into specified frames of a video clip. They can be used to accomplish a variety of tasks in your Flash projects.

Cue points can be used in conjunction with scripts to trigger the loading of movie clips, the display of text and graphics, or the playback of audio files. Cue points can also be used to synchronize video with other Flash content.

You can use cue points in conjunction with the new Flash component to coordinate the playback of a video clip with accompanying interactive content. For example, you can create a Flash presentation that has video playing in one area of the screen while descriptive text and graphics appear in another area. Cue points cause the video playback to trigger these other actions in the presentation, facilitating authoring of richer and more interactive content.

Cue points can be inserted directly into your Flash Video (FLV) files using either the Flash Video Encoder or the Video Import Wizard. You can also add and remove cue points with ActionScript using the add CuePoint and remove CuePoint methods.

Each cue point consists of a name and the time at which it occurs (see Figure 1). You specify cue point times in hour, minute, second, millisecond format; the default frame rate is 30 frames per second (fps). You can specify cue point times with any frame rate and also express them in milliseconds rather than frame numbers.

For each cue point, Flash populates the cue point list with a placeholder that includes the name of the cue point, the time during playback when the event will be triggered and the type of cue point—navigation or event.

Types of Cue Points
You can use several different kinds of cue points with Flash Video, including Navigation cue points, Event cue points, or ActionScript cue points, as discussed in the following sections.

Navigation Cue Points
Navigation cue points enable users to seek to a specified part of a file. Embed Navigation cue points in the FLV stream and FLV metadata packet when the FLV file is encoded.

Navigation cue points create a keyframe at the specified cue point location, so you can use code to move a video player’s playhead to that location. You can set particular points in an FLV file where you might want users to seek. For example, your video might have multiple chapters or segments, and you can control the video by embedding navigation cue points in the video file.

If you plan to create an application in which you want users to navigate to a cue point, create and embed cue points when encoding the file instead of using ActionScript cue points (described next) because embedded cue points are more accurate.

Event Cue Points
Event cue points can also be embedded in your FLV stream and FLV metadata packet when video clip is encoded. You can write code to handle the events that are triggered at specified points during FLV playback.

ActionScript Cue Points
ActionScript cue points are external cue points created with ActionScript. You can write code to trigger these cue points in relation to the video’s playback. They are less accurate than embedded cue points (up to one-tenth of a second) because the video player tracks them separately.

Parameters can also be established for each cue point. Parameters are sets of key-value pairs that are passed to the ActionScript method triggered by the cue point. Parameters can be used to perform tasks such as indicating which text or graphic content should be displayed for each cue point. You can access cue point parameters by writing ActionScript. Cue point parameters are a part of the event object received with the cuePoint event.

By James Gonzalez

http://www.peachpit.com/articles/article.aspx?p=663087

2009-6-12