ActionScript 2.0 Components Language Reference |
|
|
|
| FLVPlayback Component > FLVPlayback class > FLVPlayback.progress | |||
Flash Player 8.
Flash Professional 8.
varlistenerObject:Object = new Object();listenerObject.progress = function(eventObject:Object):Void{// insert event-handling code here}; my_FLVplybk.addEventListener("progress",listenerObject);
Event; dispatched at the frequency specified by the progressInterval property, starting when the load begins and ending when all bytes are loaded or there is a network error. Default is every .25 seconds.
Dispatched only for a progressive HTTP download. Indicates progress in number of downloaded bytes. The event object has the bytesLoaded and bytesTotal properties, which are the same as the FLVPlayback properties of the same names.
The event also has the property vp, which is the index number of the video player to which this event applies. For more information on the vp property, see FLVPlayback.activeVideoPlayerIndex and FLVPlayback.visibleVideoPlayerIndex.
The following example sets the progressInterval property to 001 milliseconds because the FLV file is short and then shows the number of bytes loaded for each occurrence of the progress event.
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.progressInterval = 001;
my_FLVPlybk.contentPath = "http://www.helpexamples.com/flash/video/water.flv";
var listenerObject:Object = new Object();
listenerObject.progress = function(eventObject:Object):Void {
trace(eventObject.bytesLoaded);
}
my_FLVPlybk.addEventListener("progress", listenerObject);
FLVPlayback.activeVideoPlayerIndex, FLVPlayback.addEventListener(), FLVPlayback.bytesLoaded, FLVPlayback.bytesTotal, FLVPlayback.progressInterval, FLVPlayback.visibleVideoPlayerIndex
|
|
|
|