insaniak
June 1st, 2006, 04:01 AM
I'm getting quite into this Flash 8 way of working now :).
You call the code on the movieclip like: mc_name.fade(speed,direction) - where speed is a number between 0 and your max_blur value, and direction is 1 to fade away, and -1 to fade up. max_blur is the maximum amount you want the image to blur by!
import flash.filters.BlurFilter;
max_blur = i = 30; //set the maximum blur value // i is variable to keep track of current blur value
MovieClip.prototype.fade = function (speed,direc) { //direc: 1=fadeOut, -1=fadeIn
this.onEnterFrame = function(){
if((_root.i<=_root.max_blur && direc == -1) || (_root.i>=0 && direc == 1)){
myBlur = new BlurFilter(_root.i,_root.i,1);
this.filters = [myBlur];
_root.i -= (speed*direc);
if(_root.i < 0) _root.i = 0;
}
}
}
And you call it like this:
tape_mc.fade(7,1);
Examples:
HTML / SWF File (http://www.pronto.plus.com/flash8/fade_on_rollover.html) | .fla file (http://www.pronto.plus.com/flash8/fade_on_rollover.fla)
Hope it's useful :thumb:
You call the code on the movieclip like: mc_name.fade(speed,direction) - where speed is a number between 0 and your max_blur value, and direction is 1 to fade away, and -1 to fade up. max_blur is the maximum amount you want the image to blur by!
import flash.filters.BlurFilter;
max_blur = i = 30; //set the maximum blur value // i is variable to keep track of current blur value
MovieClip.prototype.fade = function (speed,direc) { //direc: 1=fadeOut, -1=fadeIn
this.onEnterFrame = function(){
if((_root.i<=_root.max_blur && direc == -1) || (_root.i>=0 && direc == 1)){
myBlur = new BlurFilter(_root.i,_root.i,1);
this.filters = [myBlur];
_root.i -= (speed*direc);
if(_root.i < 0) _root.i = 0;
}
}
}
And you call it like this:
tape_mc.fade(7,1);
Examples:
HTML / SWF File (http://www.pronto.plus.com/flash8/fade_on_rollover.html) | .fla file (http://www.pronto.plus.com/flash8/fade_on_rollover.fla)
Hope it's useful :thumb: