Monday, June 22, 2009

Active image presentation using the mouse

This, step by step, detailed action script lesson, will show you how to create trendy image presentation using the mouse and action script code. You can use this presentation for any flash banner, for some flash animation... Using this lesson, you will also learn how to convert any image into a Movie Clip Symbol, how to animate it, create invisible button and much much more!


Example:

Move your mouse cursor over the image to see presentation!




Step 1

First, download images for this lesson!

Step 2

Create a new flash document. Press Ctrl+J key on the keyboard (Document Properties) and set the width of your document to 410 pixels and the height to 256 pixels. Select white as background color. Set your Flash movie's frame rate to 30 and click ok.



Step 3

Call the current layer images. Double-click on its default name (Layer 1) to change it. Press Enter once you have typed in the new name!

Step 4

Choose File > Import > Import to Library. In the file explorer window that appears, find two images (image 1 and image 2) and Shift-click to select them all. Then click open. If you now open your flash library (Ctrl+L key) you will see two images that you just imported. See the picture below!



Step 5

Select the Selection Tool (V) and using the drag and drop technique, move the first image from the Library on the stage.

Step 6

While the image is still selected, hit F8 key (Convert to Symbol) to convert it into a Movie Clip Symbol.



Step 7

While the new made Movie Clip (image) is still selected, go to the Align Panel (Ctrl+K) and do the following:

1. Make sure that the Align/Distribute to Stage button is turned on,
2. Click on the Align horizontal center button and
3. Click the Align vertical center button.



Step 8

Double-click on the movie clip on stage with the Selection tool(V). You should now be inside the Movie Clip.



Step 9

Click now on frame 15 and hit F5 key.

Step 10

Call the current layer image 1. Double-click on its default name (Layer 1) to change it. Press Enter once you have typed in the new name!

Step 11

Create a new layer above the layer image 1 and name it image 2. After that, move the second image from the flash library on the flash stage and aligned it with the background.

Step 12

While the second image is still selected, hit F8 key (Convert to Symbol) to convert it into a Movie Clip Symbol.



Step 13

Click now on frame 15 and hit F6 key.

Step 14

Go back now on the first frame, select the Selection Tool (V) and click once on the image to select it. Then, go to the Properties Panel (Ctrl+F3) below the stage. On the right, you will see the Color menu. Select Alpha in it and put it down to 0%.



Step 15

Right-click anywhere on the gray area between the two keyframes on the timeline and choose Create Motion Tween from the menu that appear.

Step 16

Create a new layer above the layer image 2 and name it action.

Step 17

Select now the first frame of layer action and go to the Action Script Panel (F9). After that, enter this code inside the actions panel:

stop ();

this.onEnterFrame = function(){
if(rewind == true){
prevFrame();
}
}

this.onRollOver = function(){
rewind = false;
play();
}

this.onRollOut = function(){
rewind = true;
}

Step 18

Click now on frame 15 and hit F6 key. While you're still on frame 15, enter this code inside the actions panel:

stop();

Well done!

Don't forget to thanks for this article.