Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now