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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dynamic Text based on the Date 1

Status
Not open for further replies.

MattTuc

Programmer
Aug 3, 2004
1
US
I have been at this problem for hours now... non-stop...
This is going to be hard to describe without using my exact probelm. So here goes

I am designing a webpage for a local sport. They would like to be able to place what game is going to be going on that day on the site. For example: on Monday, they want it to say: "Pickup Game Chipeda Elementary 11:45". Then on Tuesday they want it to say: "Pickup Game Bear Creak 6:00"
and so on..

I have some code that I have tryed, but it does not work. If you could take a look at it and try to figure out what the probelm is, I would greatly appreciate it!


Code:
if (getDay = "0") {
place = "Bear Creak";
time = "Today: 1:00";
}
if (getDay = "1"){
place = "Chipeda Elementary";
time = "Today: 11:45";
}
if (getDay = "2"){
place = "Bear Creak";
time = "Today: 6:00";
}
if (getDay = "3"){
place = "Chipeda Elementary";
time = "Today: 11:45";
}
if (getDay = "4"){
place = "Summer League";
time = "Fountain Valley: 6:00";
}
if (getDay = "5" or "6"){
place = "There are no";
time = "Pickup Games Today";
}
 
For one thing, it would probably be better to see your whole code... If you can post a link to your .fla!

One other thing, an if comparisom statement takes 2 "==", not 1, as you have it posted...
 
You could also use a switch statement in there which will keep things a bit clearer:

Code:
switch (getDay) {
case 0 :
	place = "Bear Creak";
	time = "Today: 1:00";
	break;
case 1 :
	place = "Chipeda Elementary";
	time = "Today: 11:45";
	break;
case 2 :
	place = "Bear Creak";
	time = "Today: 6:00";
	break;
case 3 :
	place = "Chipeda Elementary";
	time = "Today: 11:45";
	break;
case 4 :
	place = "Summer League";
	time = "Fountain Valley: 6:00";
	break;
default :
	place = "There are no";
	time = "Pickup Games Today";
}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top