473,779 Members | 2,015 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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_cata gory)
{
case "godfather" :

function first()
{
picturePlace.sr c =
"movie_info_dat a/godfather_info/godfather_liste ning.jpg";
window.setTimeo ut("second()",2 000);
}

function second()
{
picturePlace.sr c =
"movie_info_dat a/godfather_info/godfather_deepi nthought.jpg";
window.setTimeo ut("third()",20 00);
}

function third()
{
picturePlace.sr c =
"movie_info_dat a/godfather_info/godfather_danci ngdaughter.jpg" ;
window.setTimeo ut("fourth()",2 000);
}

function fourth()
{
picturePlace.sr c =
"movie_info_dat a/godfather_info/godfather_withs on.jpg";

}

window.setTimeo ut("first()",20 00);
}

Jun 24 '06 #1
1 1797

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_cata gory)
{
case "godfather" :

function first()
{
picturePlace.sr c =
"movie_info_dat a/godfather_info/godfather_liste ning.jpg";
window.setTimeo ut("second()",2 000);
}

function second()
{
picturePlace.sr c =
"movie_info_dat a/godfather_info/godfather_deepi nthought.jpg";
window.setTimeo ut("third()",20 00);
}

function third()
{
picturePlace.sr c =
"movie_info_dat a/godfather_info/godfather_danci ngdaughter.jpg" ;
window.setTimeo ut("fourth()",2 000);
}

function fourth()
{
picturePlace.sr c =
"movie_info_dat a/godfather_info/godfather_withs on.jpg";

}

window.setTimeo ut("first()",20 00);
}


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
14951
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) { document.images.src = eval("mt" +menu+ ".src") } alert("imgOff_hidemenu"); hideMenu=setTimeout('Hide(menu,num)',500);
6
15225
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 am doing wrong? Your help will be much appreciated. Thanks
4
2372
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 which I mean here. Just for a moment, let's just take one definition for one of the
45
899
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 sure there are really good aplications for it I just cannot think of any, so if anyone can tell me why a pointer to a function is nessisary and when it can/should be used I would apreciate that. Thanks. Nori
8
3058
by: coosa | last post by:
Dear all, I have the following code: #include <iostream> #include <string> #include <sstream> using namespace std;
28
4336
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
3224
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 bastard so posting it before I forgot again... By taking this minimum code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"> <html> <head>
2
6165
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 "other function" works, not the initRotator function. Here's some examples of what I've tried 1st Example using the 2 functions on body tag: <head> <script src="css/dw_rotator.js" type="text/javascript"></script> <script...
53
8418
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 language="javascript" type="text/javascript">
0
9636
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9474
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10306
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10074
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
6724
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5373
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5503
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4037
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2869
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.