Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

UGH! Why won't my movie play? Here is code

Status
Not open for further replies.

charlesjsc

Programmer
Joined
Sep 14, 2007
Messages
15
Location
US
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;
}
}
 
It's hard to say from what you've given us (and not given us), but I can't see anywhere that "movieName" is defined. Try that for starters.

Yarrr!

Dan



Coedit Limited - Delivering standards compliant, accessible web solutions

[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top