Learn Flash Blurring an Image

Home Food Mates • Members Tutorials Forum Buy Templates Contact Us 

 


Flash Tutorials

   

Flash - Blurring a Picture

 

Free Flash Tutorial


Step 7    <<   Previous      Intro   1   2   3   4   5   6   7    >>       >>   Webwasp Mates

 

Step Seven: The Movie Clip ActionScript

  1. Turn off the visibility of the: button layer

  2. You should now be able to see the Movie Clip (Cat Fader) with the image of the cat in focus. Select the Movie Clip: Cat Fader

  3. Place the following code into the actionscript editor:

onClipEvent (load) { //sets the initial condition of the "Cat Fader" clip. In this case we want the clip to be invisible. We also want to setup a variable, named speed, to represent the amount of alpha shed or gained by the clip in every frame.
    this._alpha = 0;
    _root.speed = 15;
    }

onClipEvent (enterFrame) { //setup an onClipEvent EnterFrame function for the clip that checks to see what value the alpha of the clip is at (represented by this._alpha)

    if (this._alpha < 0) { //if the alpha is less than zero set it to zero. (I know this sounds silly, but it can exist this way without immediate, obvious effect. Without this check it is possible to delay the fade-in since the alpha continues to drop numerically). Then set the direction (i.e., dir) to zero to prevent the alpha of the clip from changing until dir has a value of plus or minus 1.
        this._alpha = 0;
        _root.dir = 0;
    }
    if (this._alpha > 100) { //if the alpha is >100, set the alpha to 100 and set dir to 0 to prevent the alpha of the clip from changing until dir has a value of plus or minus 1.
        this._alpha = 100;
    _root.dir=0;
    }    
    this._alpha = this._alpha + (_root.dir*_root.speed); //if the alpha of the clip is between 0 and 100, increment the clips alpha by the value of speed.
}

That's it for Method 2. You should now test your Movie. As always, I hope you enjoyed the tutorial, and found it easy to follow. Thank you for your time!

Cross Ref: There is also a tutorial on how to create Animated Blurred Text which rushes on and off stage: Animated Blurred Text

 

Please indicate what you thought of this tutorial 
10 is the best: 
10 9 8 7 6 5 4 3 2 1

         

Step 7    <<   Previous      Intro   1   2   3   4   5   6   7    >>       >>   Webwasp Mates


Webwasp Community: Webwasp Mates & Dates

Why not try out webwasp's new community. Meet new people, find friends in your area: Webwasp Mates & Dates

 Top of Page Home Food Mates Members Tutorials Forum Buy Templates Contact Us 
 All material on this site is protected under international copyright © law. DO NOT reproduce any material from this site without written permission. Please ask as permission is often granted.