First time here? First time here? Newsletter Signup Newsletter
Search tutorials
Author: Van_pl
Let's ROCK!

1. Create a new file

2. Create a dynamic text and set the instance name of it to 'czas'.

3. Now, select this dynamic text, and convert it to movie clip (r-click on it and choose convert to symbol.../ movie clip or press F8 and choose movie clip)

4. Select your movie clip and open the 'actions' panel. Now put this code there:
onClipEvent (enterFrame) {
data = new Date();
godziny = data.getHours();
minuty = data.getMinutes();
sekundy = data.getSeconds();
czas = godziny+" : "+minuty+" : "+sekundy;

Ill skip 1-st code line. Line 2 tells the computer to create a object Date, wich will contain our time variables.
Lines 3 to 5 is setting the variables to specific time. The comp will do this continously beacuse of '(enterFrame)' in 1-st line.

5. Save all up and test ur movie. If it's not working, then dowload example file and analyse all your work.

6. But it's one small bug here. If hour is 23:05 then clock shows 23:5. This don't looks good. If you want fix it, then you have to paste a few more lines of code.

if (sekundy<10) {
sekundy = "0"+sekundy;
if (minuty<10) {
minuty = "0"+minuty;
if (godziny<10) {
godziny = "0"+godziny;

that tells if your hour is less than 10, then it will show '0' before number. Geniously, isn't?

» Level Intermediate

Added: 2005-11-09
Rating: 5 Votes: 6
» Author
Ehhh, lol? :P I love pizza and hentai :P
» Download
Download the files used in this tutorial.
» Forums
More help? Search our boards for quick answers!
Featured Flash FLA
» Author: Inocreato
» Title: RaiseTheBlocks
» Description: Raise all the blocks to win the game
Featured Sound Loops
Image for equalize

Audio Player

» Author: TomCat Carty
» Title: The Wood
» Description: Just a little game ending or it can maybe be looped. Recorders with music box and percussion to give the feel of well, I don't know, the woods? Free to use, just credit me. thank you
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: Davisigner
» Description: Hmm... what to say about this one? It's reminiscent of the closing notes of the opening music from the Three Stooges done in a church organ style with a closing cymbal crash. I'll give this one away gratis, but feel free to check out my free loops and potential upcoming license-mandated ones over in the respective part of Flashkit.