1098 ActionScript classes
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()
method used in this example requires Flash Player
7 or later. If your SWF file includes a version 2 component, use the version 2 components
DepthManager class instead of the
MovieClip.getNextHighestDepth()
method.
Содержание FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE
Страница 1: ...ActionScript 2 0 Language Reference ...
Страница 1352: ...1352 ActionScript classes ...