Actions – Using textspace as clock
|
|
![]() |
|
|
|
Step by step |
|
|
![]() |
|
|
![]() |
|
|
![]() |
|
- Sort of text : choose Dynamic Text because the text (time) has to be able to change. - The variable in the textspace : you can call that time (attention: you will use that later in the action where you will make a reference to it) - As font choose one where all letters (and figures) are of equal size, otherwise your time will jump slightly to left or right later on. Trebuchet MS is a good example for this, or if you don’t have that one, you can also choose Courier New. |
|
so the movies starts running and our time changes. |
![]() |
|
the first frame and opening the action window by pressing F9. Copy the following text : |
![]() |
|
datum = new date; uur = datum.gethours(); minuten = datum.getminutes(); if (minuten<10) { minuten = "0"+minuten; } seconden = datum.getseconds(); if (seconden<10) { seconden = "0"+seconden; } time = uur+":"+minuten+":"+seconden; |
|
where the date is set. Then you create a variable called hour, where you set the hours in that date. The same goes for minutes and seconds, but there you’ll add a 0 if they are smaller than 10 (so the time is always of equal length). So in the end you will get a date, composed of hours, minutes and seconds, each divided by a double point. |
|
text-color. You can view the result by pressing Crtl+ENTER. |
This is a tutorial for Macromedia® Flash MX®.
Macromedia and HomeSite are trademarks or registered trademarks of
Macromedia, Inc. in the United States and/or other countries.
© Tim Beylemans. All rights reserved.





