Colour picker issue

Greetings all and I hope everyone is well.

I have a small (but probably a simple fix) issue regarding setting the position of a bitmap image object.

When I add the colour image to a movie clip - this is what I get…the movie clip placed at 0,0 as expected. While in this position, the code works correctly as it is using the bitmap image which is in the same position.

If I move the the movieclip containing the colour swatch graphic via _x and _y values, it will appear correctly, but the app will still sample the RGB values from the original position as if (and probably still is) at 0,0. See image below - the cursor is at the top but still sampling.

So I was wondering how I can move the bitmap image down to match the movieclip. Or change the code so it looks at the image within the movie clip rather than the original.

Here is the code:-


var mc:MovieClip = this.createEmptyMovieClip("mc", this.getNextHighestDepth());


//mc._x = 12;

//mc._y = 100;


var bmp:BitmapData = BitmapData.loadBitmap("colors");
mc.attachBitmap(bmp, 1);

//dont use hand cursor over the image to //be easier to choose a color 
mc.useHandCursor = false; 

//color object linked with the userColor Movie Clip, if we //change mcColor we also change the color of the Movie Clip 
mcColor = new Color(userColor); 


_root.onEnterFrame = function() 
{ //if this function return 0 the mouse is not inside the image 
    if (bmp.getPixel(_xmouse, _ymouse) != 0) 
    { 
        mcColor.setRGB("0x" + bmp.getPixel(_xmouse, _ymouse).toString(16)); 
        colorTxt.text= ("0x" + bmp.getPixel(_xmouse, _ymouse).toString(16));
    } 
} 
mcColor.setRGB("0x" + bmp.getPixel(_xmouse, _ymouse).toString(16));

As mentioned, if I uncomment out the mc._x and mc._y lines, it appears correct, but will still be sampling off the 0,0 original. If I adjust the function to check against mc.bmp it fails to find any value (scope?).

Thanks for any help on the matter.

Phil