Netstream.bytesloaded - MACROMEDIA FLASH MX 2004-ACTIONSCRIPT LANGUAGE Reference

Actionscript language reference
Table of Contents

Advertisement

NetStream.bytesLoaded

Availability
Flash Player 7.
Usage
my_ns.bytesLoaded:Number
Description
Read-only property; the number of bytes of data that have been loaded into the player. You can
use this method in conjunction with
being full—for example, to display feedback to a user who is waiting for data to be loaded into
the buffer.
Example
The following example creates a progress bar using the Drawing API and the
properties that displays the loading progress of video1.flv into the video object
bytesTotal
instance called
my_video
information about the loading progress as well.
var connection_nc:NetConnection = new NetConnection();
connection_nc.connect(null);
var stream_ns:NetStream = new NetStream(connection_nc);
my_video.attachVideo(stream_ns);
stream_ns.play("video1.flv");
this.createTextField("loaded_txt", this.getNextHighestDepth(), 10, 10, 160,
22);
this.createEmptyMovieClip("progressBar_mc", this.getNextHighestDepth());
progressBar_mc.createEmptyMovieClip("bar_mc",
progressBar_mc.getNextHighestDepth());
with (progressBar_mc.bar_mc) {
beginFill(0xFF0000);
moveTo(0, 0);
lineTo(100, 0);
lineTo(100, 10);
lineTo(0, 10);
lineTo(0, 0);
endFill();
_xscale = 0;
}
progressBar_mc.createEmptyMovieClip("stroke_mc",
progressBar_mc.getNextHighestDepth());
with (progressBar_mc.stroke_mc) {
lineStyle(0, 0x000000);
moveTo(0, 0);
lineTo(100, 0);
lineTo(100, 10);
lineTo(0, 10);
lineTo(0, 0);
}
NetStream.bytesTotal
. A text field called
loaded_txt
to estimate how close the buffer is to
bytesLoaded
is dynamically created to display
NetStream.bytesLoaded
and
629

Advertisement

Table of Contents
loading
Need help?

Need help?

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

Questions and answers

This manual is also suitable for:

Flash mx

Table of Contents