A Flash Developer Resource Site

Results 1 to 7 of 7

Thread: how to clear the blur filter?

Hybrid View

  1. #1
    Senior Member
    Join Date
    May 2000
    Posts
    347

    how to clear the blur filter?

    I am using the following code to blur a movieclip

    function blurMe(blurX, blurY) {
    import flash.filters.BlurFilter;
    quality = 1;
    filter = new BlurFilter(blurX, blurY, quality);
    filterArray = new Array();
    filterArray.push(filter);
    this.filters = filterArray;
    if (blurX == 0) {
    if (blurY == 0) {
    filterArray = [];
    this.cacheAsBitmap = false;
    }
    }
    }

    itWorks great, but I can't seem to get the blur to turn off completely. If I set the blurX&Y to 0 the Help DOCs say it will not apply a blur filter, but while there is not visual blur, I am still experiencing the FPS hit as if the movie clip where blurred.

    The Help DOCs also frequently reference "clearing" the filter. I assume that means assigning it to an empty array as I have tried here, but the FPS hit is still there.

    Anyone know how to clear it and get back my FPS after using the blur?

  2. #2
    Senior Member
    Join Date
    Aug 2000
    Location
    Montréal
    Posts
    14,141
    what about:
    delete flash.filters.BlurFilter;

    gparis

  3. #3
    Senior Member
    Join Date
    May 2000
    Posts
    347
    I tried this and it does not work.

    function blurMe(blurX, blurY) {
    if (!(blurX == 0 && blurY == 0)) {
    import flash.filters.BlurFilter;
    quality = 1;
    filter = new BlurFilter(blurX, blurY, quality);
    filterArray = new Array();
    filterArray.push(filter);
    this.filters = filterArray;
    } else {
    delete flash.filters.BlurFilter;
    }
    }

    It stays blurred and of course does not resolve the FPS issue

  4. #4
    Senior Member
    Join Date
    Aug 2000
    Location
    Montréal
    Posts
    14,141
    worked for me.

    So, either both blurX and Y never get to 0, or... something else interferes.

    For further help, post your .fla or a mock-up of it.

    gparis



    gparis

  5. #5
    Pumpkin Carving 2008 ImprisonedPride's Avatar
    Join Date
    Apr 2006
    Location
    Grand Rapids MI
    Posts
    2,377
    I'm new to the filters, but if quality is the amount of times the filter was applied, wouldn't setting it to zero stop the filter?
    The 'Boose':
    ASUS Sabertooth P67 TUF
    Intel Core i7-2600K Quad-Core Sandy Bridge 3.4GHz Overclocked to 4.2GHz
    8GB G.Skill Ripjaws 1600 DDR3
    ASUS ENGTX550 TI DC/DI/1GD5 GeForce GTX 550 Ti (Fermi) 1GB 1GDDR5 (Overclocked to 1.1GHz)
    New addition: OCZ Vertex 240GB SATA III SSD
    WEI Score: 7.6

  6. #6
    Senior Member
    Join Date
    May 2000
    Posts
    347
    posted here:

    www.spiritonin.com/radius/blurtest.fla

    there is an swf in the same directory.

    It looks like the delete flash.filters.BlurFilter; command just removes the ability to apply the blur filter, but doesn't help the performance.

    In my test with this movie, it used twice as much processor when blured, and continued to use just slightly less when blur is set to 0 (22% normal, 55% with blur, 53% with blur set to 0)

    If anyone can figure this out I would really appreciate it. I'm just about ready to post a bug to Macromedia.

  7. #7
    Senior Member
    Join Date
    May 2000
    Posts
    347
    Any luck on getting the original performance back after applying the blur and removing it?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center