![]() |
Welcome To Swish-Designs.co.uk Have a Nice Friday
Analogue Clock Tutorial - Swishmax 2
Learn how to create an Analogue Clock with swishmax 2
First Of All
You will need a clock face and some clock hands, i have made my own using the vector tools within swishmax 2, Before you start please click on the download link to download the graphics from my vector clock in the example above.Download Clock Graphics .
Step.1
Open up swishmax 2 set the movie properties to 400 x 400 pixels. to do this right click on the grey area and select Movie properties.
Now click on the import image button located at the top right hand side of the layout and insert the croped image of the clock face.
see fig 1 below to see how to import the image.
Fig.1
you should now have something looking like fig.1a below.
Fig.1a
Step.2
Crop the hands into seperate images from the clock and import them facing towards the top of the clock face using the center mark to line them up. name the hour hand (hour_hand) the minute hand name (minute_hand ) and the seconds hand name (second_hand) mark them all as a target see fig.2 below.
Fig/2
when you have imported everything into the stage select the fransform tab and drag the transform/ reference point to the middle of the clock hands circle and double click, this will set the reference point for you. see fig2.a below.
Fig.2a
you should now have something looking like fig.2b below
Fig2b
Step.3
Now add the following code to Scene_1{
time=new Date();
seconds = time.getSeconds()
minutes = time.getMinutes()
hours = time.getHours()
hours = hours + (minutes/60);
seconds = seconds*6;
minutes = minutes*6;
hours = hours*30;
second_hand._rotation=seconds;
minute_hand._rotation=minutes;
hour_hand._rotation=hours;
}
You should now have a fully working analogue clock.
Thats All Press Ctrl+T to test what you have in the flash player.
Thank you for reading have fun!..................................


