- Types of Cue Points
- Embedding Cue Points
- Adding Seek Functionality Using Cue Points
- Adding Seek Functionality, Method 2
- Using Cue Points to
- Conclusion
Adding Seek Functionality, Method 2
You can also seek to a specified cue point in an FLV file by using the seekToCuePoint() method. Here is the procedure for this technique:
- Create a new Flash document called seek2.fla.
- Drag an instance of the FLVPlayback component from the Components panel (Window > Components).
- Select the component and open the Property inspector (Window > Properties > Properties).
- Type my_flvPb in the Instance Name text box.
- With the FLVPlayback instance still selected, click the Parameters tab.
- Type
http://www.helpexamples.com/flash/video/cuepoints.flv
in the contentPath text box (see Figure 8).
Figure 8 The path to the cuepoints.flv file on the Helpexamples server
When you type the URL in the contentPath text box, the cue points appear in the Parameters tab (next to cuePoint parameter), as shown in Figure 9. Therefore, you can determine the name of the cue point that you want to find in your code. If you click the magnifying glass icon, you can view all the video file’s cue points and information about each cue point in a table.
Figure 9 The cue points as they appear in the Parameters tab
- Drag an instance of the Button component from the Components panel to the Stage.
- Select the Button component and type my_button in the Instance Name text box.
- Select Frame 1 on the Timeline and type the following code in the Actions
panel (see Figure 10):
import mx.video.FLVPlayback; var my_flvPb:FLVPlayback; my_flvPb.autoPlay = false; my_button.label = "Seek to point2"; function clickMe(){ my_flvPb.seekToNavCuePoint("point2"); } my_button.addEventListener("click", clickMe);
- Select Control > Test Movie to test your code.
Figure 10 Carefully enter this script in the Actions pane.
As related above, the cuepoints.flv file contains three navigation cue points. When you click the button, the FLVPlayback instance seeks to the specified cue point, in this case cue point, "point2".