(FMX2004)Why?Why?Why?

I’m teaching myself this so I’m just an actionscript baby. Would anyone mind taking a peek at this code and telling me why I just see this output? Thank you…thank you so much!

OUTPUT:
12:undefinedAM
It is now 12:undefinedAM onundefined,undefined undefined, undefined.

CODE:
function myTime(){
var currentTime;
if(my_date.getHours() > 12){
currentTime = my_date.getHours() - 12 + “:” + my_date.getMinutes() + “PM”;
}else if((my_date.getHours() < 12) && (my_date.getHours() != 0)){
currentTime = my_date.getHours() + “:” + my_date.getMinutes() + “AM”;
}else if(my_date.getHours() == 12){
currentTime = my_date.getHours() + “:” + my_date.getMinutes() + “PM”;
}else{
currentTime = “12:” + my_date.getMinutes() + “AM”;
}
return currentTime;
}
trace(myTime());

function weekday() {
myDay = Array(“Sunday”, “Monday”, “Tuesday”, “Wednesday”, “Thursday”, “Friday”, “Saturday”);
return myDay[my_date.getDay()];
}
function myMonth() {
var month = new Array(“January”, “February”, “March”, “April”, “May”, “June”, “July”, “August”, “September”, “October”, “November”, “December”);
return month[my_date.getMonth()];
}
trace("It is now “+ myTime() + " on”+ weekday() + “,” + myMonth() + " " + my_date.getDate() + ", " +my_date.getFullYear() + “.”);

you’re using “my_date”'s methods, but u havnt defined it…

just add this at the start of your code:

var my_date = new Date();

[size=1]btw, use[noparse]


[/noparse] tags[/size]