2 Replies Latest reply on Aug 18, 2006 9:55 AM by FlashAmit

    BlurFilter

    FlashAmit
      I was trying to blur the lines. But this is not working .... Please help
      Just copy paste following code on first frame and test it. Else you can download here.

      Code:



      import flash.filters.BlurFilter;
      var blurX:Number = 40;
      var blurY:Number = 40;
      var quality:Number = 5;
      var filter:BlurFilter = new BlurFilter(blurX, blurY, quality);
      var filterArray:Array = new Array();
      filterArray.push(filter);
      m.filters = filtersArr;
      //=========================
      myLines.filters = filterArray;
      this.createEmptyMovieClip("myLines", this.getNextHighestDepth());
      function drawLine() {
      myLines.lineStyle(5, 0xff0000, 100);
      //myLines.beginFill(0xff0000);
      myLines.moveTo(ix, iy);
      //myLines.lineTo(ix+6, iy+6);
      //myLines.lineTo(ex+6, ey+6);
      myLines.lineTo(ex, ey);
      myLines.filters = filtersArr;
      }
      var ix, iy, ex, ey, keepDraw;
      onMouseDown = function () {
      ix = _xmouse;
      iy = _ymouse;
      keepDraw = setInterval(function () {
      ex = _xmouse;
      ey = _ymouse;
      drawLine();
      ix = ex;
      iy = ey;
      }, 10);
      };
      onMouseUp = function () {
      clearInterval(keepDraw);
      };
      // Assign the filters array to the filters property
      // of imageClip in order that the filters will
      // get applied.


        • 1. Re: BlurFilter
          Darshan Rane Level 3
          You just missed the variables name
          and blur value was more play with it
          look for ARROWS for changes


          import flash.filters.BlurFilter;
          var blurX:Number = 5; // <===
          var blurY:Number = 5; // <===
          var quality:Number = 100;
          var filter:BlurFilter = new BlurFilter(blurX, blurY, quality);
          var filterArray:Array = new Array();
          filterArray.push(filter);
          m.filters = filterArray; // <===
          //=========================

          myLines.filters = filterArray; // <===
          this.createEmptyMovieClip("myLines", this.getNextHighestDepth());
          function drawLine() {
          myLines.lineStyle(5, 0xff0000, 100);
          //myLines.beginFill(0xff0000);
          myLines.moveTo(ix, iy);
          //myLines.lineTo(ix+6, iy+6);
          //myLines.lineTo(ex+6, ey+6);
          myLines.lineTo(ex, ey);
          myLines.filters = filterArray; // <===
          }
          var ix, iy, ex, ey, keepDraw;
          onMouseDown = function () {
          ix = _xmouse;
          iy = _ymouse;
          keepDraw = setInterval(function () {
          ex = _xmouse;
          ey = _ymouse;
          drawLine();
          ix = ex;
          iy = ey;
          }, 10);
          };
          onMouseUp = function () {
          clearInterval(keepDraw);
          };
          // Assign the filters array to the filters property
          // of imageClip in order that the filters will
          // get applied. Text
          • 2. Re: BlurFilter
            FlashAmit Level 1
            Thank you very much.. I was really been much puzzled....

            Thanks again.

            Amit