影格第一格
music = new Sound();
music.attachSound("10 - August's Rhapsody.mp3");
music.start(0, 999999);
music.setVolume(0);
vol = 0;
step = 1;
fade = 0;
onEnterFrame = function() {
// set fade out
if (fade == 1) {
vol = vol-step;
if (vol<0) {
vol = 0;
}
music.setVolume(vol);
// set fade in
} else {
vol = vol+step;
if (vol>100) {
vol = 100;
}
music.setVolume(vol);
}
}
soundButton.onRelease = function() {
(_root.fade=!_root.fade) ? 1 : 0;
}
按鈕部份
on (press) {
(_root.fade=!_root.fade) ? 0 : 1;
}
沒有留言:
張貼留言