• flickr
  • linkedin
  • twitter
  • rss
Dynamically add Filters to objects AS3

Dynamically add Filters to objects AS3

To add filter effects to DisplayObjects in AS3 it is just as easy as applying text formatting or color formatting – well, there’s an extra intermediary in there but it’s much the same idea.

Easier to show an example than to explain:

var blurred:BlurFilter = new BlurFilter(blurAmount, blurAmount);
var filters:Array = [blurred];
myMc.filters = filters;

You’ll end up with a blurred myMC. Be sure to import the appropriate filters (flash.filters)

Tech Reference:

Larry's a 30-something chap interested in travel, being a dork and changing the world via less boring training.

Leave a reply