4 Replies Latest reply on Mar 24, 2007 7:58 PM by kglad

    Colour finding

      Hey, what I want to do is make it so that the actionscript automaticly finds a certain pixel's colour (pre-loaded jpegs included) using coordinates (x,y axis). I have looked in the help and cant seem to find it anywhere.
        • 1. Re: Colour finding
          mclem Level 1
          not sure if you are making a color picker or not but here is one already prebuilt and if ur not you can download the source and get the code for the custom color window, which has the functionality you desire in it
          • 2. Re: Colour finding
            Level 7
            > I have looked in the help and cant seem to find it anywhere

            As long as you are using Flash 8, try the getPixel method of the bitMapData

            ActionScript classes > BitmapData (flash.display.BitmapData) > getPixel
            (BitmapData.getPixel method)

            You will need to create a BitmapData object, paste your image data into it,
            then do a getPixel on the relevant pixel.

            If you're using < Flash 8, you have a problem...;)

            Remove '_spamkiller_' to mail

            • 3. Re: Colour finding
              KillerHurdz Level 1
              Hey, thx for the help. I have gotten it to work where it will get the colour of a pixel located in a bitmap, but only a bitmap that is already inside the document. What I want is for it to be able to do the same thing to a jpeg that is loaded outside of the document, an external image.
              • 4. Re: Colour finding
                kglad Adobe Community Professional & MVP
                load your jpeg into a target movieclip, create a bitmap object and use the draw method of bitmaps to "copy" your movieclip/jpeg onto the bitmap. now use your bitmap object.