1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
|
this.chargMus._visible=true;
onEnterFrame = function() {
this.pourcentage =
Math.round((music.getBytesLoaded()/music.getBytesTotal())*100);
if(this.pourcentage)chargmusic.text = this.pourcentage+"%";
}
//------------------
music = new Sound();
music.onLoad = function() {
this.stop();
delete _parent.onEnterFrame; // preload...
chargMus.text ="";
};
music.loadSound("mamusique/tonson.mp3", 0);
//------------------
music.onSoundComplete = function(){
this.chargMus._visible=false;
}
this.banc.onRollOver = function() {
music.start();
}
this.banc.onRollOut = function() {
music.stop();
}
/* ####################################
Sinon si ton son est leger tu le mets dans la bibliotheque et tu lui mets un identifiant : ici sonBonus*/
this.banc.onRollOver = function() {
var my_sound:Sound = new Sound();
my_sound.attachSound("sonBonus");
my_sound.start();
}
this.banc.onRollOut = function() {
var my_sound:Sound = new Sound();
my_sound.attachSound("sonBonus");
my_sound.stop();
} |
Partager