Frame 1
function updateTimer() {
dt = new Date();
minight = (dt.getHours() * 60) + dt.getMinutes();
newAlpha = 100 - ((Math.abs(minight - 720) / 720) * 100);
day._alpha = newAlpha;
if (dt.getHours() >= 10) {
hr = dt.getHours();
} else {
hr = "0" + dt.getHours();
}
if (dt.getMinutes() >= 10) {
min = dt.getMinutes();
} else {
min = "0" + dt.getMinutes();
}
if (dt.getSeconds() >= 10) {
sec = dt.getSeconds();
} else {
sec = "0" + dt.getSeconds();
}
time.text = (((hr + ":") + min) + ":") + sec;
}
stop();
updateTimer();
setInterval(updateTimer, 100);
bg = new Sound(day);
bg.attachSound("bg");
bd = new Sound(night);
bd.attachSound("bd");
if ((dt.getHours() <= 18) | (dt.getHours() >= 6)) {
bd.setVolume(0);
bg.setVolume(100);
stop();
bg.start("bg");
bg.onSoundComplete = function () {
this.start();
};
}
if ((dt.getHours() >= 19) | (dt.getHours() <= 5)) {
bg.setVolume(0);
bd.setVolume(100);
stop();
bd.start("bd");
bd.onSoundComplete = function () {
this.start();
};
}
Symbol 11 Button
on (release) {
if (bg.getVolume() == 0) {
bg.setVolume(100);
bd.setVolume(0);
} else {
bg.setVolume(0);
}
}
on (release) {
if (bd.getVolume() == 0) {
bd.setVolume(100);
bg.setVolume(0);
} else {
bd.setVolume(0);
}
}