MACROMEDIA FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE Reference page 1098

Actionscript 2.0 language reference
Table of Contents

Advertisement

pb._y = 100;
with (pb.bar_mc) {
beginFill(0x00FF00);
moveTo(0, 0);
lineTo(pb_width, 0);
lineTo(pb_width, pb_height);
lineTo(0, pb_height);
lineTo(0, 0);
endFill();
_xscale = 0;
}
with (pb.vBar_mc) {
lineStyle(1, 0x000000);
moveTo(0, 0);
lineTo(0, pb_height);
}
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+"%";
}
The
MovieClip.getNextHighestDepth()
7 or later. If your SWF file includes a version 2 component, use the version 2 components
DepthManager class instead of the
1098
ActionScript classes
method used in this example requires Flash Player
MovieClip.getNextHighestDepth()
method.

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Flash 8

Table of Contents