Function undefined problem? attempting to use setTimeout() to pause execution of functions.

N

Noggon

Maybe I'm stupid, but I can't find out what is wrong, can anyone help?

I keep getting the function first as being undefined for some reason I
don't get.

I'm trying to use setTimeout() to pause execution so that an image in
my web page is switched every two seconds for another.


switch(pic_catagory)
{
case "godfather" :

function first()
{
picturePlace.src =
"movie_info_data/godfather_info/godfather_listening.jpg";
window.setTimeout("second()",2000);
}

function second()
{
picturePlace.src =
"movie_info_data/godfather_info/godfather_deepinthought.jpg";
window.setTimeout("third()",2000);
}

function third()
{
picturePlace.src =
"movie_info_data/godfather_info/godfather_dancingdaughter.jpg";
window.setTimeout("fourth()",2000);
}

function fourth()
{
picturePlace.src =
"movie_info_data/godfather_info/godfather_withson.jpg";

}

window.setTimeout("first()",2000);
}
 
N

Noggon

Noggon said:
Maybe I'm stupid, but I can't find out what is wrong, can anyone help?

I keep getting the function first as being undefined for some reason I
don't get.

I'm trying to use setTimeout() to pause execution so that an image in
my web page is switched every two seconds for another.


switch(pic_catagory)
{
case "godfather" :

function first()
{
picturePlace.src =
"movie_info_data/godfather_info/godfather_listening.jpg";
window.setTimeout("second()",2000);
}

function second()
{
picturePlace.src =
"movie_info_data/godfather_info/godfather_deepinthought.jpg";
window.setTimeout("third()",2000);
}

function third()
{
picturePlace.src =
"movie_info_data/godfather_info/godfather_dancingdaughter.jpg";
window.setTimeout("fourth()",2000);
}

function fourth()
{
picturePlace.src =
"movie_info_data/godfather_info/godfather_withson.jpg";

}

window.setTimeout("first()",2000);
}

Whoops, doubled post this by accident, sorry folks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top