How use Filter in ActionScript 3.0

var gf:GlowFilter = new GlowFilter(0xff0000,.5,4,4,3,3);
var bf:BlurFilter = new BlurFilter(4,4,3);
hero_mc.filters = [gf,bf]; // Instance Name of Movie Clip is (hero_mc)
* Filter Randomly Change */

addEventListener(Event.ENTER_FRAME , loop);

function loop(e:Event){
bf.blurX = Math.random()*10;
bf.blurY = Math.random()*10;
gf.color = Math.random()*0xffffff;
hero_mc.filters = [gf,bf];
}

View Demo

Advertisements

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