Home     Drop Shadow Filter     Blur Filter     Glow Filter     Bevel Effect     Bonus Effects

Drop Shadow Filter (2)

The easiest way to create a drop shadow is to use the Filters Panel. Make sure the Symbol you want to work with is selected then open the Filters Panel and click "+". A menu with all the filters will appear, so select Drop Shadow. This will apply a default filter to the object, filter that can be removed by pressing "-".

Select the value of each parameter depending of how you want the shadow to look. This technique creates the shadow at compile-time, and the parameters can't be changed when the animation plays (run-time). Use it only when you want a static shadow.

But what do you do if you want a dynamic shadow? Action Script is the answer. In the Main Timeline, apply the next code on any frame (if you followed our indications exactly, you must have only one frame with the "mc" object).

// this is the code inside the source file
// Step1: the parameters of the shadow
var Distance:Number = 10;
var Angle:Number = 45;
var color:Number = 0x000000;
var transparency:Number = .8;
var BlurX:Number = 14;
var BlurY:Number = 14;
var Strength:Number = 2;
var Quality:Number = 3;
var InnerShadow:Boolean = false;
var Knockout:Boolean = false;
var HideObject:Boolean = false;
// Step2: creating the custom filter
import flash.filters.DropShadowFilter;
var filter:DropShadowFilter = new DropShadowFilter(
   Distance,
   Angle,
   color,
   transparency,
   BlurX,
   BlurY,
   Strength,
   Quality,
   InnerShadow,
   Knockout,
   HideObject;
// Step3: applying the filter to our Movie Clip
var tempfilter:Array = new Array();
tempfilter.push(filter);
mc.filters = tempfilter;

Each object in flash (text, Movie Clip, button etc) has a special array that holds the filters: [name].filters ([name]= the name of the object)

< Back   Next >

Download .ZIP   Download .FLA