First time here? First time here? Newsletter Signup Newsletter
Login | Register | 651326 Members and growing! | Flash Jobs
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
(10 being the highest)
» 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!

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.