Adding Glow to a Shape in AS3

Adding a glow to a programatically drawn shape is very easy in actionscript. We just need to create the GlowFilter object and apply it to the filters property. A quick example is follows

var whiteGlow:GlowFilter = new GlowFilter(0xFFFFFF, 0.8, 30, 30, 1, 1, false, false);

var sp:Sprite = new Sprite();
this.addChild(sp);
sp.graphics.drawCircle(100,100,50);
sp.filters = [whiteGlow];

That’s it. Similary you can add other filters such as GradientFilter, BlurFilter, etc. For a detail list of the available display filters refer the livedocs : Available Display Filters.

Happy Coding guys. 🙂

Advertisements

Tags: , , , , ,

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: