By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,516 Members | 1,176 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,516 IT Pros & Developers. It's quick & easy.

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

P: n/a
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);
}

Jun 24 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a

Noggon wrote:
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.

Jun 24 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.