• home
  • forum
  • my
  • kt
  • download
  • Apply Glow effect on image using the AS

    Author: 2009-07-14 04:16:44 From:

    In this thoroughly explained, detailed lesson, I will show you how to apply Glow filter on any image using the AS code. You can use this effect for some flash 
    Step 1

    Create a new flash document. Press Ctrl+J key on the keyboard (Document Properties) and set your Flash movie's frame rate to 30 and click ok.



    Step 2

    Choose now File > Import > Import to Stage (Ctrl+R) and import any image into a flash stage.

    Step 3

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



    Step 4

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



    Step 5

    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 6

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

    Step 7

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

    import flash.filters.*;

    var gf:GlowFilter = new GlowFilter(0x70A146, 15, 18, 14, 3, 3, true, false);
    var ds:DropShadowFilter = new DropShadowFilter(2, 35, 0x70a146, 5, 5, 5, .8, 3, false, false, false);

    image.filters = [gf, ds];
    image.onRollOver = function() {
     this.onEnterFrame = function() {
      gf.blurX += (80-gf.blurX)/5;
      gf.blurY = gf.blurX;
      image.filters = [gf, ds];
     };
    };

    image.onRollOut = function() {
     this.onEnterFrame = function() {
      gf.blurX += (20-gf.blurX)/5;
      gf.blurY = gf.blurX;
      image.filters = [gf, ds];
      if (gf.blurX<21) {
       delete this.onEnterFrame;
      }
     };
    };

    Test your Movie (Ctrl+Enter) now!

    We're done!

    Have a nice day!

    Download source file (.fla)
    button, banner. Using this lesson, you will also learn how to convert any image into a Movie Clip Symbol, how to apply action script code on it, how to create instance name and much much more!

    Example:

    discuss this topic to forum

    relation tutorial

    No information

    Category

      3D (36)
      Math Physics (18)
      3rd Party (10)
      Navigation (70)
      Actionscripting (239)
      Optimization (17)
      Animation (185)
      Projector (11)
      Audio (54)
      Special Effects (173)
      Backend (26)
      Text Effects (93)
      Drawing (34)
      Tips and Techniques (58)
      Dynamic Content (38)
      Tricks (8)
      Games (114)
      Utilities (24)
      Getting Started (99)
      Video (59)
      Interactivity (48)
      Web Design (37)

    New

    Hot