0 Replies Latest reply on Aug 6, 2007 3:18 PM by Peter Hahmann

    Applying and Removing Filters

    Peter Hahmann Level 1
      Hi,
      I have folowing code:

      var obj01:MovieClip;
      import flash.filters.BlurFilter;
      function aplicaGlow(act:String):Void {
      var glow:GlowFilter = new GlowFilter();

      if(act == 'on'){
      glow.color = glow.color=0xffffff;
      glow.blurX = glow.blurY=10;
      glow.strength = 2;
      }
      else if(act == 'off') {
      glow.blurX = glow.blurY=0;
      glow.strength = 0;

      obj01.filters = [glow];
      }
      }
      aplicaGlow('on');
      // aplicaGlow('off');

      If I use the "aplica on/off", everything works. But now i have following chalange:

      I must apply/remove this filter on mc's, thru buttons, which are inside mcs.

      For example:

      If the user hits bt1 (which is inside mc1), mc1 receives the glow filter. If the user hits bt2 (which is inside mc2), mc2 receives the glow filter and the glow filter of mc1 is removed.

      I hope that I war clear enought.

      Thanks,
      Peter