I'm trying to add a filter in AS3/Flex SDK. I can add a filter just fine to any one single object - but I want to apply the filter to everything that is a child of a certain object.
Think a pause window pops up, and everything below the pause window goes blurry.
Applying a filter to each individual object (eg: iterating through a list) doesn't work, as the filters from each object can then overlap and look pretty ugly.
Does anyone know how to go about doing this? Is there a way to apply a filter to everything?
Here's a simplified version of the code:
myCanvas.graphics.beginFill(0x00FF00,0.5);
myCanvas.graphics.drawRect(0,0,100,100);
myCanvas.addChild(new vectorImage());
myCanvas.addChild(new vectorImage2());
var blur:BlurFilter = new BlurFilter();
myCanvas.filters = [blur];
Neither the directly-drawn graphics nor the children get the blur effect applied. I've tried altering the defaults and tried other filters:
var colors:Array = [0xEDEDED, 0xCCCCCC, 0x211b28, 0x211b28, 0x211b28];
var alphas:Array = [0, 1, .35, .5, 1];
var ratios:Array = [0, 50, 100, 115, 155];
myCanvas.filters = [new GradientGlowFilter(0, 0, colors, alphas, ratios, 50, 50, 1, 3, "full", false)];
With identical effects (that is to say: none). What DOES work, is:
var vi:MovieClip = new vectorImage();
myCanvas.addChild(vi);
vi.filters = [blur];
but produces the above mentioned problems with multiple filters not aligning properly.