ActionScript 2.0 Components Language Reference |
|
|
|
| FLVPlayback Component > FLVPlayback class > FLVPlayback.isFLVCuePointEnabled() | |||
Flash Player 8.
Flash Professional 8.
my_FLVplybk.isFLVCuePointEnabled(time:Number) my_FLVplybk.isFLVCuePointEnabled(name:String) my_FLVplybk.isFLVCuePointEnabled(cuePoint:Object)
time A number that is the time, in seconds, of the cue point for which to search.
name A string that is the name of the cue point for which to search.
cuePoint A cue point object with time and name properties for the cue point. The method does not check any other properties on the incoming cue point object. If time or name is undefined, the method uses only the property that is defined.
A Boolean value that is false if the cue point or cue points are found and are disabled, and true if the cue point is not disabled or does not exist. If the time given is undefined, null, less than 0, or only a cue point name is provided, the method returns false only if all cue points with this name are disabled.
Method; returns false if the FLV file embedded cue point is disabled. You can disable cue points either by setting the cuePoints property through the Flash Video Cue Points dialog box or by calling the setFLVCuePointEnabled() method.
The return value from this function is meaningful only when the metadataLoaded property is true, the metadata property is not null, or after a metadataReceived event. When metadataLoaded is false, this function always returns true.
The following example disables the point2 cue point when the ready event occurs. When the first cuePoint event occurs, the event handler calls the isFLVCuePointEnabled() method to see if the cue point is disabled and, if so, the event handler enables it. The FLV file contains the following embedded cue points: point1, 00:00:00:418; point2, 00:00:07.748; point3, 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.addEventListener("ready", ready);var listenerObject:Object = new Object();listenerObject.cuePoint = function(eventObject:Object) {trace("Elapsed time in seconds: " + my_FLVPlybk.playheadTime);trace("Cue point name is: " + eventObject.info.name);trace("Cue point type is: " + eventObject.info.type);if (my_FLVPlybk.isFLVCuePointEnabled("point2") == false) {my_FLVPlybk.setFLVCuePointEnabled(true, "point2");}}my_FLVPlybk.addEventListener("cuePoint", listenerObject);my_FLVPlybk.contentPath = "http://www.helpexamples.com/flash/video/cuepoints.flv";
FLVPlayback.cuePoint, FLVPlayback.findCuePoint(), FLVPlayback.findNearestCuePoint(), FLVPlayback.findNextCuePointWithName(), FLVPlayback.setFLVCuePointEnabled(), FLVPlayback.seekToNavCuePoint(), FLVPlayback.seekToNextNavCuePoint(), FLVPlayback.seekToPrevNavCuePoint()
|
|
|
|