Import the graphics onto the stage, and use trace-bitmap to convert it into flash graphics. Select the white area and delete it, leaving only the black lines. Select the whole thing and convert it to a symbol and call it maze_mc.

maze_mc.hitTest(x,y,true)

will return true if the x,y coordinates are touching one of your walls.

If I have time, I'll post an example using your original image.

- Jim