Clock using actionscript
Shake Effect on Action Script Using Flash 3.0
Step 1: Open a new flash file. Choose Window > Properties from the main menu bar to open the PROPERTIES panel.
Step 2: Expand the Properties section in the panel and choose the Edit button to enlarge the Document Settings window. Next, set the width to 550 pixels and height to 300 pixels in the
PROPERTIES panel, as shown in Figure below. Choose the Ok button.
Step 3: Now we need to draw an oval for masking. Select the Oval tool from tools. Draw an circle in the document.
Step 4: Fill the color (#99FFFF) inside the oval. And name the document on left-top as shake effect on Action Script.
Step 5: Place the button on the document and give instance name it Reset as figure shown below.
Step 6: Create a timeline for layer 1 and name it as player.
Step 7: Create another layer for controlling effects and named it as controls. And for frame select the rectangle tool from toolbar.
Step 8: Create a fourth layer for Performing Action Script.
Step 9: Type the following Action Script in Layer-4(Action Script).
Step 10: Import shake effect images to library. Images name should be same as in library and script. Go to library panel and right click on each image. Choose Properties à Linkage. Check the “Export for Action script” option. And run the program.
Flash Analog Clock
This discussion group will teach you how to create an Analog Clock in Flash
Steps to Follow
1. Open a new flash document. Create a clock like below using flash tools.
2. Now draw an clock second hand using line tool in new layer and convert into movieclip (F8). Name the movieclip as sec.
3. Like that create hour and minute hand and convert into movieclip then name it as hrs and mins respectively.
4. Now place the second, minute, hour hands at the center pivot point of the clock as like below.
5. Totally we have 4 layers. Create 5th layer for actionscript. Select 5th layer first frame and press F9 and type the below code:
_root.onEnterFrame = function ()
{
a = new Date();
setProperty(“sec”, _rotation, a.getSeconds() * 6);
setProperty(“mins”, _rotation, a.getMinutes() * 6);
setProperty(“hrs”, _rotation, a.getHours() * 30 + a.getMinutes() / 2);
};
Note: This clock run according to the system time.
Click here to download the source Analog Clock