Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

AS3 blur filter help

New Here ,
Mar 28, 2014 Mar 28, 2014

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

TOPICS
ActionScript
398
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Mar 28, 2014 Mar 28, 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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 28, 2014 Mar 28, 2014
LATEST

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines