Blur photo header animation

Date: 22.9.2009, 17:26    Total views: 6936

In this thoroughly explained, detailed flash lesson, I will show you how to create blur photo header animation using some special flash tips and tricks and action script 3. Using this lesson, you will also learn how to import any photo into a flash stage, how to convert it into a movie clip symbol, how to create instance name and much much more! You can use this blur animation for some presentation or for some other flash components!

Example:

Move your mouse cursor over photo!




Step 1

First, find any photo which you like to use for this lesson.



Step 2


Create a new flash document. Press Ctrl+J key on the keyboard (Document Properties) and set the dimensions of your document as the dimensions of photo. Select any color as background color. Set your Flash movie's frame rate to 32 and click ok.

Step 3

Call the current layer photo. 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 any photo into a flash stage.

Step 5

While the wallpaper 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 (wallpaper) 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 7

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 photo_mc. See the picture below!



It's time for action script code. Select the first frame of layer photo and go to the AS panel (F9) below the stage. After that, enter this code inside the actions panel:

var blurSpeed:Number = 1;

photo_mc.addEventListener (MouseEvent.MOUSE_OVER, mouseOverphoto_mc);

photo_mc.addEventListener (MouseEvent.MOUSE_OUT, mouseOutphoto_mc);

photo_mc.addEventListener (Event.ENTER_FRAME, enterFramephoto_mc);

var blur:BlurFilter = new BlurFilter();
blur.blurX = 22;
blur.blurY = 22;
blur.quality = BitmapFilterQuality.HIGH;
photo_mc.filters = [blur];

var mouseIsOverphoto_mc:Boolean = false;

function mouseOverphoto_mc (event:MouseEvent):void {
 mouseIsOverphoto_mc = true;
}

function mouseOutphoto_mc (event:MouseEvent):void {
 mouseIsOverphoto_mc = false;
}

function enterFramephoto_mc (event:Event):void {

 if (mouseIsOverphoto_mc == true) {
  blur.blurX -= blurSpeed;
  blur.blurY -= blurSpeed;
 }
 
if (mouseIsOverphoto_mc == false && blur.blurX <= 22) {
  blur.blurX += blurSpeed;
  blur.blurY += blurSpeed;
 }

 photo_mc.filters = [blur];
}

That's it!

Test your movie (Ctrl+Enter) and enjoy!

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!