Add shadow without offset to moviklip

I am trying to add a shadow (no offset) to a movie clip in Flash. Using the ActionScript below, I can add an offset shadow.

import flash.filters.DropShadowFilter;

var dropShadow:DropShadowFilter = new DropShadowFilter(5, 45, 0x333333, 20, 10, 10, 1, 2, false, false, false); 
container_mc.filters = new Array(dropShadow);

      

How do I create a drop shadow effect without any offset (around the movie clip)?

0


a source to share


4 answers


You can start by setting the distance property to zero.

var dropShadow:DropShadowFilter = new DropShadowFilter(0, 45, 0x333333, 20, 10, 10, 1, 2, false, false, false);
container_mc.filters = [dropShadow]; // the brackets are shorthand for a new array

      



If that's not to your liking, try the black GlowFilter .

+2


a source


You have to use GlowFilter for this



0


a source


All you need is a glow filter

new GlowFilter (color, alpha, blurX, blurY, strength, quality, interior, knockout);

Glow filter class reference

0


a source


As you can see here, http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/filters/DropShadowFilter.html#DropShadowFilter%28%29

You must change the first argument,

import flash.filters.DropShadowFilter;

var dropShadow:DropShadowFilter = new DropShadowFilter(0., 45, 0x333333, 20, 10, 10, 1, 2, false, false, false); 
container_mc.filters = new Array(dropShadow);

      

or you can change the distance later,

dropShadow.distance = 0.;

      

Also, you realized that the last three arguments you used are the defaults, so you can shorten this part to shorten the code,

import flash.filters.DropShadowFilter;

var dropShadow:DropShadowFilter = new DropShadowFilter(0., 45, 0x333333, 20, 10, 10, 1, 2); 
container_mc.filters = new Array(dropShadow);

      

Good luck with flash / as3!

0


a source







All Articles