Forum Moderators: open

Message Too Old, No Replies

Actionscript to remove a filter?

Gradient Glow applied with actionscript, but how do i remove it?

         

Frasnko

4:21 pm on Aug 30, 2007 (gmt 0)

10+ Year Member



I am working on a flash interactive map and when a user clicks on a name in a directory list, the corresponding building (movie clip) plays. The client asked for a little more emphasis on the building, so I scripted a gradient glow on the selected building... problem is that the gradient glow stays there after the clip has played. I need the gradient glow filter to disappear after a few seconds (one or two).
It looks like I can delay an action with the setInterval() function, but how can I then get rid of this filter? I have very minimal actionscript debugging skills. Any advise would be greatly appreciated.

Here is how i set up the filter:

// Makes the filter available to use in the Movie.
import flash.filters.GradientGlowFilter;
// The Arrays (lists) below must all have the same number of entries.
// Lists the colors to use in the Gradient.
var colors:Array = [0xFFFFFF, 0x990000, 0x990000];
// Sets the transparency of each color.
var alphas:Array = [0, 0.4, 0.3, 0.8];
// Set the position of each color.
var ratios:Array = [0, 32, 64, 128, 255];
// Creates a variable with info about the Filter settings.
var myGradientGlowFilter = new GradientGlowFilter (0, 0, colors, alphas, ratios, 30, 25, 1, 2, "full", false);

Then it is applied within a function like this:
movie.filters = [myGradientGlowFilter];

Seems like i could call a filters.clear or something, but it hasn't seemed to work!

Thanks in advance!