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

Advent Style Calendar

Status
Not open for further replies.

jFernandes

Programmer
Oct 2, 2008
6
I am using the following code to highlight the correct day of the week by having 7 different frames with each day of the week highlighted in a movie clip called "week":

var my_date:Date = new Date();
var ournow:Number=my_date.getDay();
ournow+=1;
week.gotoAndStop(ournow)

I'd like to do the same for a period of 30 days (November 17 - December 21) but I'm having trouble setting up the variable. Any help is greatly appreciated. Thanks.
 
Ok, thanks for nothing. Your contribution is going to be a really useful thread on a Google search.

For anyone interested I ended up setting up a different frame for each date.

Code:
var dayWeek:Date = new Date();
var ournow:Number=dayWeek.getDay();
ournow+=1;
week.gotoAndStop(ournow)

var theDate:Date = new Date();
var doIt:Number=theDate.getDate();
if (theDate.getMonth() == 11)
{
	doIt += 16;
}
else
{
	doIt -= 16;
}
calendar.gotoAndStop(doIt)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top