473,395 Members | 1,915 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

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

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
1 1773

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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: domeceo | last post by:
can anyone tell me why I cannot pass values in a setTimeout function whenever I use this function it says "menu is undefined" after th alert. function imgOff(menu, num) { if (document.images) {...
6
by: marktm | last post by:
Hi- I am trying to use setInterval to call a method within an object and have not had any luck. I get "Object doesn't support this property or method" when I execute the following code. What I...
4
by: Michael | last post by:
Hi, I'm having difficulty finding any previous discussion on this -- I keep finding people either having problems calling os.exec(lepev), or with using python's exec statement. Neither of...
45
by: noridotjabi | last post by:
What is the purpose of the function pointer? Why do you need a pointer to a function. I cannot really think of any application where this is the only or even easiest solution to a problem. I'm...
8
by: coosa | last post by:
Dear all, I have the following code: #include <iostream> #include <string> #include <sstream> using namespace std;
28
by: Larax | last post by:
Best explanation of my question will be an example, look below at this simple function: function SetEventHandler(element) { // some operations on element element.onclick = function(event) {
7
by: VK | last post by:
I was getting this effect N times but each time I was in rush to just make it work, and later I coudn't recall anymore what was the original state I was working around. This time I nailed the...
2
by: WGW | last post by:
Hello all, I need another set of eyes cause it just isn't working, no matter how identical I make it. The initRotator function works when called by itself, but when adding another function, only the...
53
by: souporpower | last post by:
Hello All I am trying to activate a link using Jquery. Here is my code; <html> <head> <script type="text/javascript" src="../../resources/js/ jquery-1.2.6.js"</script> <script...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.