Super Fast: How to Add a Drop Shadow

Adding a dropshadow effect to a Display Object in Actionscript 3 is really easy. In Actionscript 3, Display Objects such as MovieClips have a property called filters.

To apply a drop shadow to your MovieClip, you must first import the DropShadowFilter. Then create a DropShadowFilter instance. Lastly, assign your new filter to the MovieClip’s filters property:

1
2
3
4
import flash.filters.DropShadowFilter;

var dropshadow:DropShadowFilter = new DropShadowFilter(15,45,10,0.5, 10.0, 10.0,1.0);
myDisplayObject.filters = [dropshadow];

I won’t get into the values passed to the DropShadowFilter constructor to make this short and sweet. If you would like to learn more about the particulars of this filter, see: Actionscript 3 Reference Manual

Share on FacebookShare on Google+Share on StumbleUponTweet about this on TwitterEmail this to someone

Facebook comments:

Leave a Reply