EasyManua.ls Logo

MACROMEDIA FLASH 8-FLASH LITE 2.X ACTIONSCRIPT LANGUAGE - Getbytesloaded (Sound.getbytesloaded Method)

MACROMEDIA FLASH 8-FLASH LITE 2.X ACTIONSCRIPT LANGUAGE
780 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
600 ActionScript classes
with (pb.stroke_mc) {
lineStyle(3, 0x000000);
moveTo(0, 0);
lineTo(pb_width, 0);
lineTo(pb_width, pb_height);
lineTo(0, pb_height);
lineTo(0, 0);
}
var my_interval:Number;
var my_sound:Sound = new Sound();
my_sound.onLoad = function(success:Boolean) {
if (success) {
trace("sound loaded");
}
};
my_sound.onSoundComplete = function() {
clearInterval(my_interval);
trace("Cleared interval");
}
my_sound.loadSound("song3.mp3", true);
my_interval = setInterval(updateProgressBar, 100, my_sound);
function updateProgressBar(the_sound:Sound):Void {
var pos:Number = Math.round(the_sound.position/the_sound.duration 100);
pb.bar_mc._xscale = pos;
pb.vBar_mc._x = pb.bar_mc._width;
pb.pos_txt.text = pos+"%";
}
See also
position (Sound.position property)
getBytesLoaded (Sound.getBytesLoaded method)
public getBytesLoaded() : Number
Returns the number of bytes loaded (streamed) for the specified Sound object. You can
compare the value of
getBytesLoaded() with the value of getBytesTotal() to determine
what percentage of a sound has loaded.
Availability: ActionScript 1.0; Flash Lite 2.0
Returns
Number - An integer indicating the number of bytes loaded.

Table of Contents

Related product manuals