Internet Commerce

Partners & Affiliates

Developer Channel


Featured Flash FLA
Gallery Downloads 11401 Flash Movies | 5 New Flash Movies Added
What's New | Top 100

Featured FLA

»  Author Miguel Panos
»  Title: Tarta
»  Description: It is a circle graph or pie chart that takes the data entered by user
»  More by Miguel Panos


Random FLAs | Add Flash Movie
Featured Flash Site
Gallery Downloads 4839 Flash Sites | 1 New Flash Links
What's New | Top 100 Flash Site

Featured Site

»  AuthorDeft Creative Ltd
»  Link: Home Page
»  Description: Portfolio site for .DeftCreative Ltd. A UK based web design studio specialising in flash websites, games and interactive CDROMs. With an emphasis on making things different.


Random Links | Add your own Flash Related Links
Flash Tutorials 1484 Tutorials 7 New Tutorials Added!
What's New | Top100

» Making Automatic Training Screen Capture Easily
» Create Undersea Life Animation
» Making Deinterlace Video with a low bitrate Easily
» How To Make A Simple Animation Using Christmas Clips
» Simple Step by step flash game tutorial Spot the diffrence
» How To Make A Moving Text Slide
» Create Flash Banner With Text Float Effect
» How To Make Zoo Photos Slideshow
» How To Make A Dolphin Photos Slideshow
» Unknown Tag: Title10
Random Tutorial | Add Site


Tutorials Home What's New Top Rated Submit myTutes Random!

Search Tutorials


Tutorials Tutorials » Actionscripting/Basic

Categories Countdown to Event
Author: n8 | Website: http://www.alloyedband.com |

 
Page 1
1

First, you'll need to make a movie with a text box in it. The movie (or at least the section that will contain the timer) should be the same amount of frames as your framerate is set to (12 fps by default). The text box should have a name in the "variable" field. You'll use this name in the code where I used "timetil" (you'll see later). Then simply put the action script in.

For displaying the time, use the following actionscript anywhere in those 12 frames...
currentDate = new Date(); eventDate = new Date(Year,Month-1,Day,Hour,Mins,Secs,Millisecs); var sum = 0; total = eventDate-currentDate; days = Math.ceil((total)/(1000*60*60*24)) - 1; sum += days * (1000*60*60*24); hours = Math.ceil((total - sum) / (1000*60*60)) - 1; sum += hours * (1000*60*60); minutes = Math.ceil((total - sum) / (1000*60)) - 1; sum += minutes * (1000*60); seconds = Math.ceil((total - sum) / (1000)) - 1; if (seconds == 60) seconds = "00"; if (length(minutes) == 1) { minutes = "0" + minutes; } if (length(seconds) == 1) { seconds = "0" + seconds; } timetil = (days+" days, "+hours+":"+minutes+":"+seconds+" until our next performance!"); ... You can basically copy and paste that code. It should be pretty univeral. You'll need to change the values of the "eventDate = new Date(..." to an actual date in the format: yyyy, mm, dd, hh, mm, ss, ms Keep in mind that your Month value needs to be 1 less than the actual month. Ex: March would be 2, January 0, etc.

After that, all you need to do is make those 12 frames loop over and over again. It will display like a realtime clock counting down until the event!

1

» Level Intermediate

Added: : 2006-02-23
Rating: 5.71 Votes: 10
Hits: 1106
» Author
I'm a person, just like you.
» Download
Download the files used in this tutorial.
Download (0 kb)
Get conversion and unzipping tools for PC and Mac here!

» Forums
More help? Search our boards for quick answers!

Please rate this tutorial, 10 is the top rating, you can also click the comments link to read/write a review.
10 9 8 7 6 5 4 3 2 1
Read or Post Comments