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

Flash lite 2.x actionscript language reference
Hide thumbs Also See for FLASH 8-FLASH LITE 2.X ACTIONSCRIPT LANGUAGE:
Table of Contents

Advertisement

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
what percentage of a sound has loaded.
Availability: ActionScript 1.0; Flash Lite 2.0
Returns
- An integer indicating the number of bytes loaded.
Number
600
ActionScript classes
with the value of
getBytesLoaded()
to determine
getBytesTotal()

Advertisement

Table of Contents
loading

Table of Contents