BitmapData hitTesting

Hello,

So right, I’m kind of new at this bitmapData thing… only got Flash 8 a month ago. But I’ve seen what it can do, and from what I’ve seen, I can get better hitTesting results by using bitmapData.

Usually, with movie clips, trying to check hitTest on any other shape than a square causes problems. The “box” in which the movie clip lies, which defines height and width, returns True to hitTest when it comes into contact with another object. With bitmapData the problem is solved… right?

Point is, I’m trying to create an engine that can check if a small, horizontal line is touching a movie clip. That should be simple enough, right? Here’s the code I have so far:

import flash.display.BitmapData;
import flash.geom.Point;
var myBitmapData:BitmapData = new BitmapData(100, 80, false, 0x00CCCCCC);
var target:MovieClip = this.createEmptyMovieClip("mc", this.getNextHighestDepth());
target.attachBitmap(myBitmapData, this.getNextHighestDepth());
var follow:MovieClip = createThickLine(5, 50, 0xFF0000);
var destPoint:Point = new Point(myBitmapData.rectangle.x, myBitmapData.rectangle.y);
var currPoint:Point = new Point();
follow.onEnterFrame = function() {
    currPoint.x = follow._x;
    currPoint.y = follow._y;
    if (myBitmapData.hitTest(destPoint, 255, currPoint)) {
        trace(">> Collision at x:"+currPoint.x+" and y:"+currPoint.y);
    }
};
follow.startDrag(true);
function createThickLine(width:Number, height:Number, color:Number):MovieClip {
    var depth:Number = this.getNextHighestDepth();
    var mc:MovieClip = this.createEmptyMovieClip("mc_"+depth, depth);
    mc.lineStyle(width, 0xFF0000)
    mc.moveTo(0, -(height/2));
    mc.lineTo(0, height);
    //mc._rotation += 45;
    return mc;
}

The problem with this code is that the movie clip follow, which is a thick red line, only returns hitTest when the exact center of the line touches myBitmapData. So, what do you guys think?

Thanks,
-Raven~Storm