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/

Auto-advance to next slide:
     MediaPlayback on main Presentation slide
     MediaPlaybacks on individual Child slides

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.

  1. Starting from one of the two scenarios described above ...

    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.

  2. The project organization:

    presentation

      slide1

      slide2

      slide3

      slide4

      slide5

      ...

    Establish a Cue Point

    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).

  3. Determine when you want the slide presentation to advance:

    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).

  4. Establish a Cue Point:
    1. Select the myPlayback MediaPlayback instance on the presentation slide (or, if you are working with smaller FLV clips and instances of the MediaPlayback component on individual child slides, select the first child slide containing a MediaPlayback instance)

      In the Component Inspector:

    2. Scroll to the bottom of the Component Inspector, until you see the [+] Add CuePoint button
    3. Click on the Add CuePoint [+] button
      1. CuePoint Name:  slide2

        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.

      2. CuePoint Position: 0:0:4:400   HH:MM:SS:mmm    (4 seconds, 400 milliseconds)
  5. Apply the automatic Slide CuePoint Navigation behavior:
    1. Select the myPlayback MediaPlayback instance on the main presentation slide

      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

    2. Open the Behaviors panel
    3. Add Behavior [+] -> Media -> Slide CuePoint Navigation
    4. As directed in the dialog box, select the parent slide of the child slides (through which the automatic navigation will take place), then click:  OK

      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.

    5. Click:  OK
  6. Save and test movie

    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.

  7. Continue adding CuePoints, applying the name of the slide to go to for the CuePoint name
  8. Save and test

    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
Home