Skip to main content
Participant
March 29, 2014
Question

AS3 blur filter help

  • March 29, 2014
  • 1 reply
  • 424 views

Hi, I am fairly new to ActionScript three and I encountered a problem while creating a simple painting application -- I was adding a blur slider to allow the lines to be blurry whenever someone draws, but what I did was make all lines already drawn become blurry. 

blurSlider.addEventListener(Event.CHANGE, changeBlurFilter);

function changeBlurFilter (SliderEvent):void { 

 

var myFilter:BitmapFilter = new BlurFilter(blurSlider.value,blurSlider.value, BitmapFilterQuality.LOW);

var lineFilters:Array = new Array();

lineFilters.push(myFilter);

board.filters = lineFilters;

          }

This is the code currently. board is the canvas that can be drawn on.  So as of now everytime the blur slider is changed all marks on the board become blurry -- which is not the intention. Is there a way to add the filter to something like

board.graphics.lineStyle.(sizeSlider.value, selectedColor, alphaSlider.value).filters = lineFilters;

Of course this does not work, but this would change the linestyle to become blurry. Is there another way to do this?

Thanks a lot in advanced

This topic has been closed for replies.

1 reply

Ned Murphy
Legend
March 29, 2014

Unless I missed reading it, it seems like you are only describing what it does that you don't want it to do, but you don't indicate what you do want it to do. 

If what you want is for each line to be drawn based on the current blur setting but not affect existing lines, it might be a case where you need to treat each line as a separate 'board' and apply the filter to each board.

lava400Author
Participant
March 29, 2014

Yes, you are correct on it all, and I came to the conclusion that is what I need to do, but I don't see a way to treat each line seperate. Which is why I put the second peice of code -- it is the lineStyle -- but it doesn't seem you can put a filter on it. I know it is possible to do what I want, but I don't know how to do it or where to go to look for help.