1

So, this article looks at how to get the color from an image in AS3, and one of the answers suggests a better way to grab colors using the 'draw' function of a BitmapData object. But these are somewhat limiting, I'm trying to implement an eyedropper-type utility and need to be able to know what color the user is seeing at a certain pixel.

I've tried using draw() on the stage, but that doesn't include anything that's a child of the stage. Next, it occurred to me that I could just look at the children of the stage to find the foremost one that's under the mouse, and draw() that, but then we suddenly get into a possibly time consuming recursive search. does anyone have any better ideas? The simplest/fastest/best way to find what color is being displayed under the mouse in Actionscript 3.

Community
  • 1
  • 1
Dogmatixed
  • 794
  • 1
  • 11
  • 33
  • draw should work fine with children... – Cay Dec 23 '09 at 23:52
  • It seems Cay is right, because I wasn't using the alpha channel in my BitmapData object it looked like the children weren't being captured in draw(). – Dogmatixed Dec 24 '09 at 02:06
  • possible duplicate of [Best way to get the color where a mouse was clicked in AS3](http://stackoverflow.com/questions/78849/best-way-to-get-the-color-where-a-mouse-was-clicked-in-as3) – Jeremy Dec 16 '13 at 23:28

1 Answers1

0

I believe you want this stack overflow question:

Best way to get the color where a mouse was clicked in AS3

Community
  • 1
  • 1
whybird
  • 1,108
  • 8
  • 19