| Flash Video FLVs and CuePoints |
| notes for Flash 7 Pro only |
A "cue point" is simply a time-based position in an audio or video stream. In Flash, it can be used as a trigger for any behavior, whether that is advancing to the next screen in a Slide Presentation, or for sending a string of text to a dynamic text field, or for loading an external SWF or JPEG.
A cue point associated with an FLV video stream can be used to automatically advance to the next slide in a Slide Presenation; or display text synchronized to the contents of the FLV video stream, like closed captioning on TV; or it can be used to trigger any other type of behavior, such as loadMovie().
Some source files are available in the folder cuepoints_mini, available by anonymous FTP from ftp://ftp.ActionScript4Designers.com/wmg3/
Scenario 1: Working with the Slide Presenation, a MediaPlayback component is placed on the main Presentation slide. The myPlayback instance loads one long FLV. Cue points are set to trigger the advancement from one child slide to the next as the FLV plays.
Scenario 2: Working with the Slide Presenation, MediaPlayback components are individually placed in different child slides. Each myPlayback instance loads one short FLV (potentially pieces of one long source file). In each myPlayback instance, a single cue point for the end of the FLV to trigger the advancement to the next child slide.
Both cases follow the same procedure, which uses a Behavior to do most of the scripting.
You have a working Slide Presentation that follows one of the two scenarios described above: a MediaPlayback instance named myPlayback on the main Presenation slide, or individual instances of the MediaPlayback component on different child slides ... each instance is named the same: myPlayback.
The myPlayback instance(s) successfully load an external FLV file. The myPlayback instance(s) has the accurate FLV Video Length established if the FLV was not created with the Flash Video Exporter.
presentation
slide1
slide2
slide3
slide4
slide5
...
A Cue Point is a moment in time (of the streaming video) that will be used to trigger some kind of behavior. In this example, we will establish a Cue Point, and use it to advance the presentation from child slide1 to slide2. The Cue Point can really be at any time ... but in this case, we will be synchronizing the speech with the display of what is being spoken (like a teleprompter or closed captioning).
Play back the SWF, and watch the time indicator in the controller area of the MediaPlayback instance.
Write down the time (minutes, seconds, milliseconds) that correspond to the point at which you want the presentation to advance to the next slide (this example will use 4 seconds, 400 milliseconds for the cue point).
In the Component Inspector:
When working with the automatic Slide CuePoint Navigation behavior, you enter the name of the slide you wish to go to as the Cue Point name. So if you were already on slide2 and wanted to automatically navigate to slide3, then you would enter slide3 as the Cuepoint name.
If not working with the automatic Slide CuePoint Navigation behavior, you can use any valid name for the cuepoint name.
In our first example, we will be using the automatic Slide CuePoint Navigation behavior.
Normally, you can name the CuePoint whatever you want to name it, but the automatic Slide CuePoint Navigation behavior requires that the CuePoint name be the name of the Slide to display when the cue point has been reached.

Or, if you have an arrangement where there are MediaPlayback instances on separate slides, select the myPlayback instance on slide1.
Or, select a MediaPlayback instance on one of the child slides, and modify the CuePoint name so that it is the name of the child slide following the current slide


This registers the behavior with a Listener.
It doesn't matter whether the MediaPlayback instance is on the main presentation slide or any of the child slides ... you are focusing the behavior on the parent of the child slides you wish to have respond to the automatic Navigation behavior.
When the FLV reaches approximately 4.4 seconds, the Slide Presentation advances to the slide named slide2
This automatic Slide CuePoint Navigation behavior requires two things: it requires that a CuePoint be established (by ActionScript or using the Component Inspector) with the CuePoint name being that of the slide to navigate to; and it requires that the Behavior panel be used to assign the Media -> Slide CuePoint Navigation behavior to the Media component which is controlling playback of the FLV.
The rest of this section involves adding additional CuePoints to the MediaPlayback instance on the main presentation slide. Since it already has been assigned the CuePoint Navigation behavior, we won't need to go back and re-apply it. However, if you are working in a presentation where there are individual MediaPlayback instances on different child slides, you will need to apply the CuePoint Navigation behavior to each MediaPlayback instance, one at a time.
To review: you determine when - at what minutes, seconds, and milliseconds while the FLV is playing - you want the Cue Point to be set at, to trigger the automatic Slide CuePoint Navigation behavior. You then set that CuePoint (with the Component Inspector or with ActionScript), applying for the Name value of the CuePoint the name of the slide you want to automatically navigate to when that CuePoint is reached during playback. You then apply the Slide CuePoint Navigation behavior to the Media component instance.
as of Saturday, May 08, 3:30pm
| copyright© 2004 Stephen McManus | May 08, 2004 |