Actionscript3 - Quick AS3 dropshadow filter example

This will add a dropshadow filter to a sprite (here symbolized as the variable oSprite):

For information on the parameters visit the actionscript pages on the dropshadow http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/filters/DropShadowFilter.html

import flash.filters.DropShadowFilter;
 
var filter = new DropShadowFilter(16,45,20,0.5, 20.0, 20.0,1.0);
oSprite.filters = [filter];
 
 

Now to remove the dropshadow again (or any other filters for that matter):

oSprite.filters = [];
Reply:
 
 
 
 
rendered @ Fri May 24 4:12:00 CEST 2013