charlesjsc
Programmer
The movie SHOULD play. I just can't figure it out. Here is the code:
function rnmovie(){
var Today = new Date();
var hours = Today.getHours();
var min = Today.getMinutes();
var sec = Today.getSeconds();
var Time = ((hours > 12) ? hours - 12 hours == 0) ? 12 :hours);
Time += ((min < 10) ? ":0" : ":") + min;
Time += ((sec < 10) ? ":0" : ":") + sec;
Time += (hours >= 12) ? " PM" : " AM";
//document.write(Time);
if ((hours == 13) || (hours == 11) || (hours == 2) || (hours == 5))
{
alert(hours);
playmovie();
}
}
rnmovie();
function playmovie() {
if (movieIsLoaded(thisMovie(movieName))) {
thisMovie(movieName).Play();
}
}
function stopmovie() {
if (movieIsLoaded(thisMovie(movieName))) {
thisMovie(movieName).StopPlay();
}
}
// Checks if movie is completely loaded.
// Returns true if yes, false if no.
function movieIsLoaded (theMovie) {
// First make sure the movie's defined.
if (typeof(theMovie) != "undefined") {
// If it is, check how much of it is loaded.
return theMovie.PercentLoaded() == 100;
} else {
// If the movie isn't defined, it's not loaded.
return false;
}
}
function rnmovie(){
var Today = new Date();
var hours = Today.getHours();
var min = Today.getMinutes();
var sec = Today.getSeconds();
var Time = ((hours > 12) ? hours - 12 hours == 0) ? 12 :hours);
Time += ((min < 10) ? ":0" : ":") + min;
Time += ((sec < 10) ? ":0" : ":") + sec;
Time += (hours >= 12) ? " PM" : " AM";
//document.write(Time);
if ((hours == 13) || (hours == 11) || (hours == 2) || (hours == 5))
{
alert(hours);
playmovie();
}
}
rnmovie();
function playmovie() {
if (movieIsLoaded(thisMovie(movieName))) {
thisMovie(movieName).Play();
}
}
function stopmovie() {
if (movieIsLoaded(thisMovie(movieName))) {
thisMovie(movieName).StopPlay();
}
}
// Checks if movie is completely loaded.
// Returns true if yes, false if no.
function movieIsLoaded (theMovie) {
// First make sure the movie's defined.
if (typeof(theMovie) != "undefined") {
// If it is, check how much of it is loaded.
return theMovie.PercentLoaded() == 100;
} else {
// If the movie isn't defined, it's not loaded.
return false;
}
}