Search tutorials
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:
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.
that tells if your hour is less than 10, then it will show '0' before number. Geniously, isn't?
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. |
| Download (0 kb) |
| » Forums |
| More help? Search our boards for quick answers! |
-
You must have javascript enabled in order to post comments.


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