First time here? First time here? Newsletter Signup Newsletter
Login | Register | 651326 Members and growing!
Search tutorials
Author: Joni Hakkarainen | Website: http://-
Ok lets start. First you need create a movie clip. Then create inside the movie clip four dynamic textboxes; one for hours, one for minutes, one for moths and one for days. Then give variable Names to hours, minutes, days and months textboxes(i used hrs, min, day, month. Then type two numbers to hours, minutes and days textboxes, and example FEB to moths textbox. Lastly move the movie clip to the main scene. Ok, lets move on to the script: copy and paste this script to the movie clip on the main scene(click the movie clip and open Actions window): onClipEvent(enterFrame) { time = new Date(); hrs = time.getHours(); min = time.getMinutes(); day = time.getDate(); month = time.getMonth(); if(min<10) {min="0" + time.getMinutes();} else if(hrs<10) {hrs="0" + time.getHours();} if(month=="0") {month="JAN"} else if(month=="1") {month="FEB"} else if(month=="2") {month="MAR"} else if(month=="3") {month="APR"} else if(month=="4") {month="MAY"} else if(month=="5") {month="JUN"} else if(month=="6") {month="JUL"} else if(month=="7") {month="AUG"} else if(month=="8") {month="SEP"} else if(month=="9") {month="OCT"} else if(month=="10") {month="NOV"} else if(month=="11") {month="DEC"} } Funny thing is that Flash things that january is in numbers "0", thats why we have to chance "0" to JAN, or you can otherwise just chance it to "1" and to everyone of them(1,2,3,4,5...) And if the clock is 05:09, flash makes it to 5:9, so we have to add those extra sripts which is shown above: if(min<10) {min="0" + time.getMinutes();} else if(hrs<10) {hrs="0" + time.getHours();} Well done, thats it!
» Level Basic

Added: 2005-02-04
Rating: 3 Votes: 10
(10 being the highest)
» Author
Student
» Download
Download the files used in this tutorial.
» Forums
More help? Search our boards for quick answers!

Comments

  • There are no comments yet. Be the first to comment!

  • You must have javascript enabled in order to post comments.

Leave a Comment
  • Your email address will not be published. All fields are required.
Featured Flash FLA
» Author: work2survive
» Title: Girl Walking 1kb
» Description: Walking girl, animation just takes 1kb, using high heels shoes, and fashion model attitude.
Featured Sound Loops
Image for equalize

Audio Player

» Author: BoxCat
» Title: CPU Talk
» Description: From the cyberpunk RPG, "Nameless: the Hackers" Completely Free to use! Keywords: edm hip hop rap electronic mysterious mission hacking chase exciting spy ios ambient chilling love happy sad angry suspense
Latest Font
» Author: Fábio FAFERS
» Description: I created this font for free use. Everyone can apply it in personal or business texts. Its free, but I want to be communicated in case of business use. Donations are accepted to keep the project of free fonts alive! Thank you all
Featured Sound Fx
Image for equalize

Audio Player

» Author: nathan
» Description:

A recorded sound of the Dimensional Fork Gate.