There are all kinds of tools to accomplish this in BitmapData, like
floodFill(). threshold() has yielded good results for me, too, but it
requires some tinkering. Look at the examples in the docs.

--Matt

On Tue, Jan 13, 2009 at 4:15 PM, peter ginsberg <malphig...@gmail.com>wrote:

> Is there any way to do color swaps in AS3?
>
> What I'm looking to do is:
> Take a given DisplayObject (MovieClip or Sprite to be specific), look for
> particular colors (specific RGB values) and replace those colors with other
> specific RGB values, all without touching any other colors.
>
> Sort of like something you would do with an indexed color image.
>
> Currently I'm doing this in a far more tedious way (making each colored
> area
> I want to swap into a named movie clip and iterating through all the
> children then tossing a color transform on the clips).
>
> I thought maybe I could work soemthing out with a ColorMatrixFilter, but it
> doesn't seem like it will work.   Maybe dealing with the whole image as bit
> map data?  Although would that be a performance concern?
>
> Thanks in advance for any advice!
> _______________________________________________
> Flashcoders mailing list
> Flashcoders@chattyfig.figleaf.com
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to