Posted: Sat Mar 15, 2008 10:02 am Post subject: Make a Digital Clock
Step 1: Create a Blank Flash Document
Start by creating a new Flash Document about 150x40 pixels, make sure you set it to ActionScript 2.0...
Step 2: Create a Dynamic Text that stretches across the frame
Start by selecting the Text Tool and dragging it across the frame to make a text. Then under the properties panel, change it from Static text to Dynamic Text... After you have done this, set the Variable area (Var: ) to the variable Time
Step 3: Add the code to the frame
We are going to use the variables, sec, min, hour, and ampm during this process
Code:
// Create a new clock
mydate = new Date();</p> <div class="codemain">
// Set the variables to the correct times
sec = mydate.getSeconds();
min = mydate.getMinutes();
hour = mydate.getHours();
ampm = " AM";
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum