Is there a way to determine concatenated filters?

I want to be able to take a symbol that may be buried in a parent/child chain and add it to the stage or the root and have it look the same. The properties transform.concatenatedColorTransform and transform.concatenatedMatrix and the localToGlobal method make this mostly pretty easy. But is there a similar way of getting all the filters that are passed down to an object? Thanks in advance.

Looks like this is easier than I thought it would be just using custom code like this:

var ancestor:DisplayObjectContainer = parent;
while (ancestor && ancestor != root) {
	filters = filters.concat(ancestor.filters);
	ancestor = ancestor.parent;
}

Still curious to hear if there’s another way though.

1 Like

There’s nothing similar to concatenatedMatrix, if that’s what you mean. Also concatenatedMatrix is itself not entirely dependable. There were some failure points for that (unless they got fixed) that would require walking up the hierarchy like with what you’re doing for filters.

1 Like

Yeah, that’s what I meant. Thanks. :slight_smile:

Oh, but what are the failure points of concatenatedMatrix?

I was afraid you were going to ask that haha. I wanted to say things dealing with cache as bitmap can cause problems since the hierarchy is flattened into an image, but this also happens with filters (filters are applied as bitmaps) and since you’re using those, that might not be it. Could be related to 2.5D transforms… Hmm. Ok, I did find this:

https://bugbase.adobe.com/index.cfm?event=bug&id=2927826

So maybe I was right the first time. I remember talking to someone about this not to long after we implemented this stuff, and I got the impression that this was FOL and not worth trying to fix it so that the implementation details were hidden in this case.

You know, I actually discovered that bizarre bug in my tests! Getting different results depending on whether there was a filter and therefore depending on whether there was cacheAsBitmap. But it looks like the only values that are off are the coordinates, so I can get around it with localToGlobal.