Bytesloaded (Netstream.bytesloaded Property) - MACROMEDIA FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE Reference

Actionscript 2.0 language reference
Table of Contents

Advertisement

this.createTextField("buffer_txt", this.getNextHighestDepth(), 10, 10, 300,
22);
buffer_txt.html = true;
var connection_nc:NetConnection = new NetConnection();
connection_nc.connect(null);
var stream_ns:NetStream = new NetStream(connection_nc);
stream_ns.setBufferTime(3);
my_video.attachVideo(stream_ns);
stream_ns.play("video1.flv");
var buffer_interval:Number = setInterval(checkBufferTime, 100, stream_ns);
function checkBufferTime(my_ns:NetStream):Void {
var bufferPct:Number = Math.min(Math.round(my_ns.bufferLength/
my_ns.bufferTime 100), 100);
var output_str:String = "<textformat tabStops='[100,200]'>";
output_str += "Length: "+my_ns.bufferLength+"\t"+"Time:
"+my_ns.bufferTime+"\t"+"Buffer:"+bufferPct+"%";
output_str += "</textformat>";
buffer_txt.htmlText = output_str;
}
If your SWF file includes a version 2 component, use the version 2 components
DepthManager class instead of the
used in this example.
See also
setBufferTime (NetStream.setBufferTime method)
,
property)
bufferLength (NetStream.bufferLength property)

bytesLoaded (NetStream.bytesLoaded property)

public bytesLoaded : Number [read-only]
The number of bytes of data that have been loaded into the player. You can use this method in
conjunction with
NetStream.bytesTotal
for example, to display feedback to a user who is waiting for data to be loaded into the buffer.
Availability: ActionScript 1.0; Flash Player 7
Example
The following example creates a progress bar using the Drawing API and the
and
properties that displays the loading progress of video1.flv into the video
bytesTotal
object instance called
display information about the loading progress as well.
var connection_nc:NetConnection = new NetConnection();
MovieClip.getNextHighestDepth()
. A text field called
my_video
,
time (NetStream.time
to estimate how close the buffer is to being full--
loaded_txt
method, which is
bytesLoaded
is dynamically created to
NetStream
969

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE and is the answer not in the manual?

This manual is also suitable for:

Flash 8

Table of Contents

Save PDF