AS3 Colour Changing
I have really complex开发者_JAVA百科 flash animation thats severely obfuscated accross several layers and over 500 Symbols. Luckily the whole animation uses just two colours, all the way through.
I need to find a way of swapping colours like this, so I can make all the red parts green, etc.
Just use the ColorMatrixFilter. It's like ColorTransform, but it allows you to mix channels. If you only use two colors and they're pure (like full red and full green) then it's easy to get any of them to individually be replaced by whatever you want.
You might be able to do something about that using ColorTransform, but it will only work if your animation's parts are separated in a way that allows for each color to be transformed individually.
Other than that, you could implement an algorithm that manually copies and transforms each frame as BitmapData. But depending on the size of the animation, this would probably slow down the whole thing significantly.
精彩评论