Skip navigation
Nickoby
Currently Being Moderated

Check pixel colour

Aug 11, 2012 12:27 AM

In a game, I want to check if a ball is 'in or out' by determining the pixel colour it has landed on - in this case the stage background colour. Can anyone help with the AS3 code? Thanks.

 
Replies
  • kglad
    62,147 posts
    Jul 21, 2002
    Currently Being Moderated
    Aug 11, 2012 9:09 AM   in reply to Nickoby

    you have to use the bitmapdata class to determine pixel color but i'm not sure that makes sense for whatever you're trying to do.  to be sure, you can't determine the stage color using it.

     

    in addition, there is probably a better way using hitTestObject or hitTestPoint to do whatever you want.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (1)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points