views:

534

answers:

4

I am trying to add a drop shadow look( without the offset) to a movie clip in Flash. Using the Actionscript below, I can add a drop shadow with an offset.

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 can I create a drop shadow effect without any offset ( all around the movie clip)?

+2  A: 

You can start with 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 a black GlowFilter instead.

grapefrukt
That worked thanks.
Iris
A: 

You should use GlowFilter for this

victor hugo
A: 

All you need is a glow filter

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

Glow Filter Class Reference

Unreality
A: 

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

You should 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 could change the distance later,

dropShadow.distance = 0.;

Also, did you realize that the last 3 arguments you used are the defaults, so you could cut that part out to shorten your 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!

PiPeep