Blur Filter:
Now, we see the blur Filter Examples...
Now we have create a movie clip and give instance name as reflec...
Main screen
1: Movie Clip
2: 2 input textfiled for Blur x and Blur y
3: Update button
Let, before open
import the filters
import mx.transitions.Tween;
import flash.filters.BlurFilter;
import mx.transitions.easing.*;
After, apply the effect to the movie
on Enterframe event
Here, the complete Code...
import mx.transitions.Tween;
import flash.filters.BlurFilter;
import flash.filters.*;
import mx.transitions.easing.*;
function update()
{
updatebtn.onPress = function()
{
applyfilter()
var s = new Tween(_root.reflec,"_x",null,0,350,5,true)
s.onMotionFinished = function()
{
s.yoyo()
}
}
}
update()
function applyfilter()
{
var blur_X = Number(_root.blurx.text)
var blur_Y = Number(_root.blury.text)
var quality = 3
var filter = new BlurFilter(blur_X,blur_Y,quality)
var filterarr = new Array()
filterarr[0] = filter
reflec.filter = filterarr
_root.onEnterFrame = function()
{
if(reflec.hitTest(_xmouse,_ymouse,true))
{
if(reflec.filters[0].blurX != 0)
{
blur_X -= 1;
blur_Y -= 1;
filter = new BlurFilter(blur_X, blur_Y, quality);
filterarr = new Array();
filterarr[0] = filter
reflec.filters = filterarr;
}
}
else
{
if(reflec.filters[0].blurX != 10)
{
blur_X += 1;
blur_Y += 1;
filter = new BlurFilter(blur_X, blur_Y, quality);
filterarr = new Array();
filterarr[0] = filter
reflec.filters = filterarr;
}
}
}
}
Have!, a gr8 effect...
Thanks....
0 comments:
Post a Comment