ActionScript 2.0 Components Language Reference |
|
|
|
| FLVPlayback Component > FLVPlayback class > FLVPlayback.setFLVCuePointEnabled() | |||
Flash Player 8.
Flash Professional 8.
my_FLVplybk.setFLVCuePointEnabled(enabled:Boolean,time:Number) my_FLVplybk.setFLVCuePointEnabled(enabled:Boolean,name:String) my_FLVplybk.setFLVCuePointEnabled(enabled:Boolean,cuePoint:Object)
enabled A Boolean value that specifies whether to enable (true) or disable (false) an FLV file cue point.
time A number that is the time, in seconds, of the cue point to set.
name The name of the cue point to set.
cuePoint A cue point object with name and time properties that matches the cue point to set. The method does not check any other properties on the incoming cue point object. If time or name is undefined, the method tries to match a cue point using only the available value.
A number. If metadataLoaded is true, the method returns the number of cue points whose enabled state was changed. If metadataLoaded is false, the method returns -1 because the component cannot yet determine which, if any, cue points to set. When the metadata arrives, however, the component sets the specified cue points appropriately
Method; enables or disables one or more FLV file cue points. Disabled cue points are disabled for purposes of being dispatched as events and for navigating to them with the seekToPrevNavCuePoint(), seekToNextNavCuePoint(), and seekToNavCuePoint() methods.
Cue point information is deleted when you set the contentPath property to a different FLV file, so set the contentPath property before setting cue point information for the next FLV file to be loaded.
Changes caused by this function are not reflected by calls to the isFLVCuePointEnabled() method until metadata is loaded.
The following example disables the point2 and point3 cue points when the ready event occurs. The cuePoint event handler shows in the Output panel the name and time of each cue point that occurs. The FLV file contains the following embedded cue points: point1 at 00:00:00:418; point2 at 00:00:07.748; point3 at 00:00:16:020.
Drag an FLVPlayback component to the Stage, and give it an instance name of my_FLVPlybk. Then add the following code to the Actions panel on Frame 1 of the Timeline:
/**
Requires:
- FLVPlayback component on the Stage with an instance name of my_FLVPlybk
*/
import mx.video.*;
function ready(eventObject:Object) {
my_FLVPlybk.setFLVCuePointEnabled(false, "point2");
my_FLVPlybk.setFLVCuePointEnabled(false, 16.02);
}
my_FLVPlybk.addEventListener("ready", ready);
function cuePoint(eventObject:Object) {
trace("Cue point name is: " + eventObject.info.name);
trace("Cue point time is: " + eventObject.info.time);
}
my_FLVPlybk.addEventListener("cuePoint", cuePoint);
my_FLVPlybk.contentPath = "http://www.helpexamples.com/flash/video/cuepoints.flv";
FLVPlayback.cuePoint, FLVPlayback.findCuePoint(), FLVPlayback.findNearestCuePoint(), FLVPlayback.findNextCuePointWithName(), FLVPlayback.isFLVCuePointEnabled(), FLVPlayback.seekToNavCuePoint(), FLVPlayback.seekToNextNavCuePoint(), FLVPlayback.seekToPrevNavCuePoint()
|
|
|
|