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!
[FONT=Courier New][LEFT][COLOR=#0000ff]import[/COLOR] flash.[COLOR=#000080]filters[/COLOR].[COLOR=#000080]BlurFilter[/COLOR];
max_blur = i = [COLOR=#000080]30[/COLOR]; [COLOR=#808080]//set the maximum blur value // i is variable to keep track of current blur value[/COLOR]
[COLOR=#0000ff]MovieClip[/COLOR].[COLOR=#0000ff]prototype[/COLOR].[COLOR=#000080]fade[/COLOR] = [COLOR=#000000]function[/COLOR] COLOR=#000000[/COLOR] [COLOR=#000000]{[/COLOR] [COLOR=#808080]//direc: 1=fadeOut, -1=fadeIn[/COLOR]
[COLOR=#0000ff]this[/COLOR].[COLOR=#0000ff]onEnterFrame[/COLOR] = [COLOR=#000000]function[/COLOR]COLOR=#000000[/COLOR][COLOR=#000000]{[/COLOR]
[COLOR=#0000ff]if[/COLOR][COLOR=#000000]([/COLOR][COLOR=#000000]([/COLOR][COLOR=#0000ff]_root[/COLOR].[COLOR=#000080]i[/COLOR]<=_root.[COLOR=#000080]max_blur[/COLOR] && direc == -[COLOR=#000080]1[/COLOR][COLOR=#000000])[/COLOR] || [COLOR=#000000]([/COLOR][COLOR=#0000ff]_root[/COLOR].[COLOR=#000080]i[/COLOR]>=[COLOR=#000080]0[/COLOR] && direc == [COLOR=#000080]1[/COLOR][COLOR=#000000])[/COLOR][COLOR=#000000])[/COLOR][COLOR=#000000]{[/COLOR]
myBlur = [COLOR=#000000]new[/COLOR] BlurFilterCOLOR=#000000[/COLOR];
[COLOR=#0000ff]this[/COLOR].[COLOR=#000080]filters[/COLOR] = [COLOR=#000000][[/COLOR]myBlur[COLOR=#000000]][/COLOR];
[COLOR=#0000ff]_root[/COLOR].[COLOR=#000080]i[/COLOR] -= COLOR=#000000[/COLOR];
[COLOR=#0000ff]if[/COLOR][COLOR=#000000]([/COLOR][COLOR=#0000ff]_root[/COLOR].[COLOR=#000080]i[/COLOR] < [COLOR=#000080]0[/COLOR][COLOR=#000000])[/COLOR] [COLOR=#0000ff]_root[/COLOR].[COLOR=#000080]i[/COLOR] = [COLOR=#000080]0[/COLOR];
[COLOR=#000000]}[/COLOR]
[COLOR=#000000]}[/COLOR]
[COLOR=#000000]}[/COLOR]
[/LEFT]
[/FONT]
And you call it like this:
[FONT=Courier New][LEFT]tape_mc.[COLOR=#000080]fade[/COLOR][COLOR=#000000]([/COLOR][COLOR=#000080]7[/COLOR],[COLOR=#000080]1[/COLOR][COLOR=#000000])[/COLOR];
[/LEFT]
[/FONT]
** Examples:**
HTML / SWF File | [URL=“http://www.pronto.plus.com/flash8/fade_on_rollover.fla”].fla file
Hope it’s useful :thumb: