# bitmapData hittesting?

**URL:** <https://forum.kirupa.com/t/bitmapdata-hittesting/220635>\
**Category:** flash\
**Created:** [March 27, 2007, 8:58pm UTC](https://forum.kirupa.com/t/bitmapdata-hittesting/220635 "2007-03-27T20:58:40Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![superbungalow](https://avatars.discourse-cdn.com/v4/letter/s/cab0a1/32.png) [@superbungalow](https://forum.kirupa.com/u/superbungalow)\
**Post date:** [March 27, 2007, 8:58pm UTC](https://forum.kirupa.com/t/bitmapdata-hittesting/220635/1 "2007-03-27T20:58:40Z")

</div>

I looked this up on the frequently asked questions thread, and found this:

[FONT=Courier New][LEFT][COLOR=#0000ff]import[/COLOR] flash.[COLOR=#000080]display[/COLOR].[COLOR=#000080]BitmapData[/COLOR];  
[COLOR=#0000ff]import[/COLOR] flash.[COLOR=#000080]geom[/COLOR].[COLOR=#000080]Point[/COLOR];  
[COLOR=#0000ff]MovieClip[/COLOR].[COLOR=#0000ff]prototype[/COLOR].[COLOR=#000080]pixelHitTest[/COLOR] = [COLOR=#000000] **function** [/COLOR][COLOR=#000000]([/COLOR]mc:[COLOR=#0000ff]MovieClip[/COLOR], threshold:[COLOR=#0000ff]Number[/COLOR][COLOR=#000000])[/COLOR]:[COLOR=#0000ff]Boolean[/COLOR] [COLOR=#000000]{[/COLOR]  
threshold = threshold ? treshold : [COLOR=#000080]1[/COLOR];

[COLOR=#000000] **var** [/COLOR] thisBitmap:BitmapData = [COLOR=#000000] **new** [/COLOR] BitmapData[COLOR=#000000]([/COLOR][COLOR=#0000ff]this[/COLOR].[COLOR=#0000ff]\_width[/COLOR], [COLOR=#0000ff]this[/COLOR].[COLOR=#0000ff]\_height[/COLOR], [COLOR=#000000] **true** [/COLOR], [COLOR=#000080]0[/COLOR][COLOR=#000000])[/COLOR];  
thisBitmap.[COLOR=#000080]draw[/COLOR]COLOR=#000000[/COLOR];  
[COLOR=#000000] **var** [/COLOR] mcBitmap:BitmapData = [COLOR=#000000] **new** [/COLOR] BitmapData[COLOR=#000000]([/COLOR]mc.[COLOR=#0000ff]\_width[/COLOR], mc.[COLOR=#0000ff]\_height[/COLOR], [COLOR=#000000] **true** [/COLOR], [COLOR=#000080]0[/COLOR][COLOR=#000000])[/COLOR];  
mcBitmap.[COLOR=#000080]draw[/COLOR]COLOR=#000000[/COLOR];

[COLOR=#0000ff]if[/COLOR][COLOR=#000000]([/COLOR]thisBitmap.[COLOR=#0000ff]hitTest[/COLOR][COLOR=#000000]([/COLOR][COLOR=#000000] **new** [/COLOR] Point[COLOR=#000000]([/COLOR][COLOR=#0000ff]this[/COLOR].[COLOR=#0000ff]\_x[/COLOR], [COLOR=#0000ff]this[/COLOR].[COLOR=#0000ff]\_y[/COLOR][COLOR=#000000])[/COLOR], threshold, mcBitmap, [COLOR=#000000] **new** [/COLOR] Point[COLOR=#000000]([/COLOR]mc.[COLOR=#0000ff]\_x[/COLOR], mc.[COLOR=#0000ff]\_y[/COLOR][COLOR=#000000])[/COLOR], threshold[COLOR=#000000])[/COLOR][COLOR=#000000])[/COLOR] [COLOR=#000000]{[/COLOR]  
[COLOR=#0000ff]return[/COLOR] [COLOR=#000000] **true** [/COLOR];  
[COLOR=#000000]}[/COLOR]  
[COLOR=#0000ff]return[/COLOR] [COLOR=#000000] **false** [/COLOR];  
[COLOR=#000000]}

Can anyone explain this in detail for me please?

Thanks  
[/COLOR][/LEFT]  
[/FONT]
