0 Replies Latest reply on Aug 15, 2007 6:56 PM by asiabackpacker

    Tweening a filter with AS

    asiabackpacker Level 1
      So, I've figured out how to turn a glow on and off using AS. Here is how I have done it:

      quote:

      button.onRollOver = function(){ fadeGlow = .7; }

      button.onRollOut = function(){ fadeGlow = 0; }

      import flash.filters.GlowFilter;

      var glow:GlowFilter = new GlowFilter(0xffffff, fadeGlow, 7, 7, 1, 3);

      button.filters = [glow];


      But my question is, is there a way to tween this transition?

      To tween an alpha, I would normally use something like:

      quote:

      fadeAlpha = (targetAlpha-_alpha) * .2;
      _alpha += fadeAlpha;


      (maybe I am even going about this wrong), but is there a similar way to tween the property of the filter that I am trying to target above?

      Thanks!

      (btw, I used quotes to insert my code because i cannot figure out a way to insert code into my post without attaching it, which just puts it at the end-is there a way to do this too?)