Help with applying simple code

ok i asked a Q a few days ago (and recieved a fab reply)

Hi
this is probably super simple - but then so am I!
Does anyone know where I may find some actionscript code that will get the time froma user’s computer and then display a message according to wether it is day or night
EG.
1am-11am = “Good morning”
12pm- 12am= “Good evening”
thanks in adavnce

 
mydate = new Date();
current_time = mydate.getHours();
if (current_time<11) {
	  message = "good morning";
}else if (current_time>12) {
	  message = "good evening";
}

but now say i have a dynamic text box (instance name message )

where do i put the AS and do i have to add an event handler

sigh it’s been so long since i’ve used flash!

thanks