03.05.2013 Views

ActionScript 2.0 Language Reference - Adobe Help and Support

ActionScript 2.0 Language Reference - Adobe Help and Support

ActionScript 2.0 Language Reference - Adobe Help and Support

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

If your SWF file includes a version 2 component, use the version 2 components'<br />

DepthManager class instead of the MovieClip.getNextHighestDepth() method, which is<br />

used in this example.<br />

See also<br />

bytesTotal (NetStream.bytesTotal property), bufferLength<br />

(NetStream.bufferLength property)<br />

bytesTotal (NetStream.bytesTotal property)<br />

public bytesTotal : Number [read-only]<br />

The total size in bytes of the file being loaded into the player.<br />

Availability: <strong>ActionScript</strong> 1.0; Flash Player 7<br />

Example<br />

The following example creates a progress bar using the Drawing API <strong>and</strong> the bytesLoaded<br />

<strong>and</strong> bytesTotal properties that displays the loading progress of video1.flv into the video<br />

object instance called my_video. A text field called loaded_txt is dynamically created to<br />

display information about the loading progress as well.<br />

var connection_nc:NetConnection = new NetConnection();<br />

connection_nc.connect(null);<br />

var stream_ns:NetStream = new NetStream(connection_nc);<br />

my_video.attachVideo(stream_ns);<br />

stream_ns.play("video1.flv");<br />

this.createTextField("loaded_txt", this.getNextHighestDepth(), 10, 10, 160,<br />

22);<br />

this.createEmptyMovieClip("progressBar_mc", this.getNextHighestDepth());<br />

progressBar_mc.createEmptyMovieClip("bar_mc",<br />

progressBar_mc.getNextHighestDepth());<br />

with (progressBar_mc.bar_mc) {<br />

beginFill(0xFF0000);<br />

moveTo(0, 0);<br />

lineTo(100, 0);<br />

lineTo(100, 10);<br />

lineTo(0, 10);<br />

lineTo(0, 0);<br />

endFill();<br />

_xscale = 0;<br />

}<br />

NetStream 983

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!