Tuesday, March 30, 2010

Using .getPixel() to Read Through a...

Hello Smart People!

I have two images, one overlayed exactly over the other. The image in front is what the user needs to see, but the user behind can be considered to be like a map with different fields of color on it representing different things.

What I am trying to do is that when the user mouses over the image, it reads (via .getPixel) the color info of the image behind which prompts certain messages to be displayed.

I am not having a problem with getting .getPixel() to work since when I just have the behind image (colored ''map'') showing, the color data for each pixel comes up as expected. But, when I overlay the top image, it shields the back image from being able to be ''read'' by my .getPixel function.

Is there a way to have a movieClip not ''interfere'' with movieClips that lay behind it in the stack?

Any help would be appreciated.

-john

Using .getPixel() to Read Through a...

getPixel handles BitmapData, it has nothing to do with MovieClips. All you need to do is save this color map clip as a BitmapData object at some point, and then use getPixel to access this data. I am not even sure how you could be calling this method with a MovieClip.

No comments:

Post a Comment