actionscript-3flashapache-flexfilterpixel-bender

More Pixel Bender Filters at Once (FLEX)


I was wondering if there is a way to apply more pixel bender at once to an image in flex.

for example i have a class of pixel bender filter that returns an Array so i can apply an effects in this way:

var class1:FilterClass1 = new FilterClass1();
bitmap.filters = class1.filter(parameters);

It works like a charm, but is there a way to apply more filters at once to that bitmap? If i call another class and apply to bitmap in the same way

var class2:FilterClass2 = new FilterClass2();
bitmap.filters = class2.filter(parameters);

It delete the first filter and apply the second.

Hope is all clear :)

Thank you


Solution

  • Have you tried joining your two arrays together and assigning them to filters... Something like:

    bitmap.filters = class1.filter(parameters).concat(class2.filter(parameters));