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:

Leave a Reply

Your email address will not be published. Required fields are marked *

Proudly powered by WordPress | Theme: Baskerville 2 by Anders Noren.

Up ↑