ActionScript 2.0 Components Language Reference |
|
|
|
| FLVPlayback Component > FLVPlayback class > FLVPlayback.bytesTotal | |||
Flash Player 8.
Flash Professional 8.
my_FLVPlybk.bytesTotal
Property; a number that specifies the total number of bytes downloaded for an HTTP download. Returns -1 when there is no stream, when the stream is from a FMS, or if the information is not yet available. The returned value is useful only for an HTTP download. Read-only.
The following example uses the bytesTotal property to display the number of bytes being loaded for an HTTP download. When the metadataReceived event occurs, the event handler displays this value in the text area my_ta.
Drag an FLVPlayback component to the Stage, and give it an instance name of my_FLVPlybk. Drag a TextArea component to the Stage below the FLVPlayback instance and give it an instance name of my_ta. Then add the following code to Frame 1 of the Timeline in the Actions panel:
/**
Requires:
- FLVPlayback component on the Stage with an instance name of my_FLVPlybk
- TextArea component on the Stage with an instance name of my_ta
*/
import mx.video.*;
my_ta.visible = false;
var listenerObject:Object = new Object();
listenerObject.metadataReceived = function(eventObject:Object):Void {
my_ta.text = "Loading: " + my_FLVPlybk.bytesTotal + " bytes.";
my_ta.visible = true;
};
my_FLVPlybk.addEventListener("metadataReceived", listenerObject);
my_FLVPlybk.contentPath = "http://www.helpexamples.com/flash/video/water.flv";
|
|
|
|