how to loop if else statement
Hello,
I want to make a open and close sign, I got to the part where I can make the MC visible or hide in certain time but I can not loop the statement.
Basically I want to show the open image from 10am to 8:30pm and the rest of the time show the close image.
Here is the code
var d:Date = new Date();
if ((d.getHours()>=10 && d.getHours()<8) || (d.getHours()==8 && d.getMinutes()<=30)){
open.visible = true;
close.visible = false;
} else {
open.visible = false;
close.visible = true;
}
trace(d)
It just read the time and show whatever the image should be, but it will not loop the whole statement again.
Can someone help me thank you.