title: Flex/Actionscript White to Transparent
body: <p>I am trying to write something in my Flex 3 application with actionscript that will take an image and when a user clicks a button, it will strip out all the white(ish) pixels and convert them to transparent, I say white(ish) because I have tried exactly white, but I get a lot of artifacts around the edges. I have gotten somewhat close using the following code: </p>
  
  <pre><code>targetBitmapData.threshold(sourceBitmapData, sourceBitmapData.rect, new Point(0,0), "&gt;=", 0xFFf7f0f2, 0x00FFFFFF, 0xFFFFFFFF, true);
  </code></pre>
  
  <p>However, it also makes red or yellows disappear. Why is it doing this? I'm not exactly sure how to make this work. Is there another function that is better suited for my needs?</p>