Evening Folks,
I frequent a few other forms on various web related stuff, but just started to really get into flash. I have a calendar I’ve been working on, I get it to auto create the days and months based off the system date. Now what I’d like to do is have my AS Highlight the current day so it stands out…
I’ve been looking over the code, trying to figure out how to get it, but I keep getting stuck. I know Flash has a built in “Date” and I’ve been trying if statements to get it to == my AS Datestamp, but I have to be doing it wrong.
Ive pieced this together from a few different calendars after seeing the code, the AS is split into 4 KeyFrames. The code below is what gets the day, and places the start cord. of the MC:
MynewDate = new Date(MyCurYear, MyCurMonth, 1);
MynewYear = MyNewDate.getFullYear();
MyNewMonth = MyNewDate.getMonth();
Display = MonthNames[MyNewMonth] add " " add MynewYear;
if (MyNewMonth == 1) {
if ((MynewYear%4) == 0) {
NoofDays[1] = 29;
} else {
NoofDays[1] = 28;
}
}
MyNoofDays = NoofDays[MyNewDate.getMonth()];
MyDay = NameofDays[MyNewDate.getDay()];
if (MyDay == "Sun") {
setProperty("_root.Numbers1", _x, 68);
} else if (MyDay == "Mon") {
setProperty("_root.Numbers1", _x, 140);
} else if (MyDay == "Tue") {
setProperty("_root.Numbers1", _x, 212);
} else if (MyDay == "Wed") {
setProperty("_root.Numbers1", _x, 284);
} else if (MyDay == "Thu") {
setProperty("_root.Numbers1", _x, 356);
} else if (MyDay == "Fri") {
setProperty("_root.Numbers1", _x, 428);
} else if (MyDay == "Sat") {
setProperty("_root.Numbers1", _x, 500);
}
i = 1;
Max = MyNoofDays;
And this bit of code dups the MC and sets the spacing:
i = Number(i)+1;
duplicateMovieClip("Numbers" add (i-1), "Numbers" add i, i);
setProperty("Numbers" add i, _x, getProperty ("Numbers" add (i-1),_x)+72);
set("Numbers" add i add ".Num", i);
if (getProperty ("Numbers" add (i-1),_x) == 500) {
setProperty("Numbers" add i, _y, getProperty ("Numbers" add (i-1),_y)+72);
setProperty("Numbers" add i, _x, 68);
}
I’m pretty sure I need to do a if statement, something like
if (MyDay == Date) {
setProperty("_root.Day1" _x, i);
gotoAndStop(9);
}
Where “Day1” is a MC that has the proper tweens and such so that when its at Frame 9, there is a small HL shade that its in a box. But It’s not seeming to work.
Here’s a link to the cal (its really bare atm, adding the actual graphics later)
http://www.egzist.com/CC/LoudandLocal/fla/calendar_v3.html
And here’s the FLA just in case:
http://www.egzist.com/CC/LoudandLocal/fla/calendar_v3.fla
Thanks for any help!! Appreciate it!