Red Glow image animation

Date: 12.10.2009, 18:2    Total views: 10923

Read this thoroughly explained, detailed flash lesson and see how to create red glow image animation using the action script code and some special flash tips and tricks. You can use this animation for some flash banner or for some flash components. Using this lesson, you will also learn how to import any image into a flash stage, how to create instance name and much more! Let's start!

Example:



Step 1

First, save the image below that we will use 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 400 pixels and the height to 300 pixels. Select black as background color. Set your Flash movie's frame rate to 99 and click ok.

Step 3

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

Step 4

Choose now File > Import > Import to stage (Ctrl+R) and import the image that you just saved into a flash stage. While the photo 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 5

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



Step 6

While the new made movie clip is still selected, go to the Properties Panel below the stage. On the left side, You will find the Instance name input field there. Call this Movie Clip image_mc. See the picture below!



Step 7

Create a new layer above the layer image and name it action script. After that, select the first frame of layer action script and go to the AS panel (F9). Then, enter the following action script code inside the actions panel:

image_mc.filters = [new flash.filters.GlowFilter()];
var dir:Number = 1;
image_mc.blur = 7;
image_mc.onEnterFrame = function() {
    image_mc.blur += dir;
    if ((image_mc.blur >= 30) || (image_mc.blur <= 7)) {
        dir *= -1;
    }
    var filter_array:Array = image_mc.filters;
    filter_array[0].blurX = image_mc.blur;
    filter_array[0].blurY = image_mc.blur;
    image_mc.filters = filter_array;
};

That's it!¨

Test your movie (Ctrl+Enter)

Have a nice day!

Download source file (.fla)

  Digg it! Add this tutorial to del.icio.us! Furl it! Add this tutorial to reddit! Spurl it! Add this tutorial to technorati!
Share
ShareSidebar