Please Note: Follow all instructions carefully. Missing any of them will make the whole thing Fail!
Analog ClockIts time to get your hands dirty. We will now make a simple analog clock like the one on the right➜➜
Getting Ready - You need to download the zip file and extract it
After downloading the file , extract it into a folder called analog clock. We will need it
|
|
Importing files
to import files : File➜Import➜To Stage
Import all the pictures that you have extracted into flash. it should look something like this. You may have to move the imported pictures appart
Import all the pictures that you have extracted into flash. it should look something like this. You may have to move the imported pictures appart
Converting pictures to objects
Lets give our objects Instance namesBefore that select all the objects. Shift to select multiple objects. Right click and click distribute to layers. This is how my timeline looks➜
Rearrange the layers like mine is for best results Select the movieclips and give each an instance name in properties
|
Editing the objectsWe need to position the picture in the object properly otherwise the Hour hand and the minute hand wont rotate properly
To EDIT
Finally go back to stage |
Position the objects
We need to position to objects properly like this
onEnterFrame=function(){ tdate=new Date// tdate has been set to system date(getting system date and time) minute._rotation=tdate.getMinutes() *6//Getting minutes and multipliying by 6 //because 360 degrees=60 minute //6 degrees= 1 minute //._rotation is used to set the angle of the object hour._rotation=(tdate.getHours() + tdate.getMinutes()/60)*30 // determining hours and setting the angle } // onEnterFrame=function(){ Code;code;} allows the code to repeat // as long as the timeline stays in this frame
Thats it!
If everything went well the clock should work
Assignment
Assignment
- Add the second hand
- experiment with ._rotation with buttons also
Download Source(CS6) | |
File Size: | 93 kb |
File Type: | fla |