# BitmapData Collision Map

**URL:** https://forum.kirupa.com/t/bitmapdata-collision-map/301676
**Category:** programming
**Created:** [December 13, 2009, 9:44pm UTC](https://forum.kirupa.com/t/bitmapdata-collision-map/301676 "2009-12-13T21:44:14Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![flyingmonkey456](https://avatars.discourse-cdn.com/v4/letter/f/e47774/32.png) [@flyingmonkey456](https://forum.kirupa.com/u/flyingmonkey456)
#### Post date: [December 13, 2009, 9:44pm UTC](https://forum.kirupa.com/t/bitmapdata-collision-map/301676/1 "2009-12-13T21:44:14Z")

</div>

(AS2) I’m using a B&W bitmap to determine passable and impassable area. White is passable, black is impassable. It isn’t working, though. Can someone tell me what’s wrong?  
The following is in the frame:

```auto

_global.AreaMap1 = BitmapData.loadBitmap(AreaMap1);

```

And this is in the character:

```auto

if(_global.Area == 1 && _global.AreaMap1.getPixel(xDest, yDest) == 0x000000)

```

The if statement is never true, when I trace \_global.AreaMap1.getPixel(xDest, yDest) I get undefined. \_global.Area does equal 1, and xDest and yDest do have values assigned to them. I got my code from tutorials so I don’t think it’s wrong, but that seems to be the only thing left.
