User Guide
FLVPlayback class 627
Usage
my_FLVPlybk.playheadUpdateInterval
Description
Property; a number that is the amount of time, in milliseconds, between each
playheadUpdate event. Setting this property while the FLV file is playing restarts the timer.
The default is 250.
Because ActionScript cue points start on playhead updates, lowering the value of the
playheadUpdateInterval property can increase the accuracy of ActionScript cue points.
Because the playhead update interval is set by a call to the global
setInterval() function,
the update cannot fire more frequently than the SWF file frame rate, as with any interval that
is set this way. So, as an example, for the default frame rate of 12 frames per second, the lowest
effective interval that you can create is approximately 83 milliseconds, or one second (1000
milliseconds) divided by 12.
Example
The following example sets the playheadUpdateInterval property to 3000 and creates a
listener that catches occurrences of the
playheadUpdate event as it occurs while the FLV file
plays. When the event occurs, the event handler shows the elapsed playhead time in the
Output panel.
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.playheadUpdateInterval = 3000;
var listenerObject:Object = new Object();
listenerObject.playheadUpdate = function(eventObject:Object):Void {
trace("playhead time is: " + eventObject.playheadTime);
};
my_FLVPlybk.addEventListener("playheadUpdate", listenerObject);
my_FLVPlybk.contentPath = "http://www.helpexamples.com/flash/video/
water.flv";
See also
FLVPlayback.playheadTime, FLVPlayback.playheadUpdate