FLVPlayback.findNextCuePointWithName()

Availability

Flash Player 8.

Edition

Flash Professional 8.

Usage

my_FLVplybk.findNextCuePointWithName(my_cuePoint:Object)

Parameters

my_cuePoint A cue point object that has been returned by either the findCuePoint() method, the findNearestCuePoint() method, or a previous call to this method.

Returns

An object that is a copy of the found cue point object with the following additional properties:

array The array of cue points searched. Treat this array as read-only because adding, removing or editing objects within it can cause cue points to malfunction.

index The index into the array for the returned cue point.

Returns null if no match was found.

Description

Method; finds the next cue point in my_cuePoint.array that has the same name as my_cuePoint.name. The my_cuePoint object must be a cue point object that has been returned by the findCuePoint() method, the findNearestCuePoint() method, or a previous call to this method. This method uses the array property that these methods add to the cue point object.

The method includes disabled cue points in the search. Use the isFLVCuePointEnabled() method to determine if a cue point is disabled.

Returns null if there are no more cue points in the array with a matching name.

Example

The following example creates three ActionScript cue points with the name "transition". When the ready event occurs, the event handler calls the findCuePoint() method to find the first cue point with this name. If it finds a match, it calls the findNextName() function, which calls the findNextCuePointWithName() method, passing the returned cue point object (rtn_obj), to find any additional cue points with the same name.

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.*;
my_FLVPlybk.contentPath = "http://www.helpexamples.com/flash/video/cuepoints.flv";
var cuePt:Object = new Object(); //create cue point object
cuePt.time = 6.27;
cuePt.name = "transition";
cuePt.type = "actionscript";
my_FLVPlybk.addASCuePoint(cuePt);  //add AS cue point
cuePt.time = 7.06;
my_FLVPlybk.addASCuePoint(cuePt);  //add AS cue point
cuePt.time = 11.13;
my_FLVPlybk.addASCuePoint(cuePt);  //add AS cue point
var listenerObject:Object = new Object();
listenerObject.ready = function():Void {        
    var rtn_obj:Object = new Object();
// Find cue point using name string
    if (rtn_obj = my_FLVPlybk.findCuePoint("transition")) {
        trace("Cue point name is: " + rtn_obj.name);
        trace("Cue point time is: " + rtn_obj.time);
        trace("Cue point type is: " + rtn_obj.type);
        findNextName(rtn_obj);
    }
}
my_FLVPlybk.addEventListener("ready", listenerObject);
// Find additional cue points with the same name
function findNextName(cuePt:Object):Void {
    while(cuePt = my_FLVPlybk.findNextCuePointWithName(cuePt)) {
            trace("Cue point name is: " + cuePt.name);
            trace("Cue point time is: " + cuePt.time);
            trace("Cue point type is: " + cuePt.type);
    }
}

See also

FLVPlayback.addASCuePoint(), FLVPlayback.cuePoints, FLVPlayback.findCuePoint(), FLVPlayback.findNearestCuePoint(), FLVPlayback.isFLVCuePointEnabled(), FLVPlayback.removeASCuePoint(), FLVPlayback.seekToNavCuePoint(), FLVPlayback.seekToNextNavCuePoint(), FLVPlayback.seekToPrevNavCuePoint(), FLVPlayback.setFLVCuePointEnabled()