This content has been marked as final. Show 6 replies
not the cleanest code, but i had this laying around in an old project...
date = new Date()
month = date.getMonth() + 1
today = date.getDate()
fyear = date.getFullYear()
hours = date.getHours()
minutes = date.getMinutes()
seconds = date.getSeconds()
month = "0"+month
today = "0"+today
hours = "0"+hours
minutes = "0"+minutes
seconds = "0"+seconds
CurrentTime.text = month+"/"+today+"/"+fyear+" "+hours+":"+minutes+":"+seconds
do i attached this to the dynamic "text field" or to the "frame on the action layer"
in my example, you'd put it on the action layer, and it would output to a textfiled named CurrentTime
Thanks Tony. The last thing is would you know how to get the seconds, minutes, and hours to continue changing as the moive is playing. It would be much appericated.
I would put the other code inside a function:
//date stuff goes in here
then call it once a second:
intID = setInterval(updateTime,1000)
you could do the same thing with an onEnterFrame, but then you'd be making a lot of useless calls....this way you'll only call it as often as new information is available.