Okay, so I'm making a flash site that's supposed to have a day/night cycle that works in real time
Right now, the plan is to have a ten frame animation play once and stop after it reached the end of the movieclip timeline when the clock hits a certain time and a movie is loaded
The problem is that whenever try testing the animation, it loops. I believe the problem is that a duplicate of the movieclip keeps attaching itself in the original's place
PHP Code:
stop();
var updateTime = setInterval(currenttime, 1000);
function currenttime() {
var today = new Date();
var minutes = today.getMinutes();
var hours = today.getHours();
trace(today);
trace(minutes);
trace(hours);
var DAWN = hours == 5 && minutes == 00;
var DAY = hours == 20 && minutes == 15;
if (DAWN<today) {
attachMovie("TownEarly", "TownEarly", 10);
unloadMovie(TownDay);
trace("It is dawn");
}
if (DAWN<DAY) {
attachMovie("TownDay", "TownDay", 10);
unloadMovie(TownEarly);
trace("It is day");
}
}
Is there a way to check if a movieclip is already attached and then prevent a duplicate from taking it's place