Example: http://www.swfcabin.com/open/1249862606
Code:
/*This code generates the command "pixelHitTest". This command can be used exacly as the
normal hitTest is used, but with the difference that you have to put the registration point
of the Movie clips that are going to have collision, on the TOP LEFT*/
import flash.display.BitmapData;
import flash.geom.Point;
MovieClip.prototype.pixelHitTest = function(mc:MovieClip, threshold:Number):Boolean {
threshold = threshold ? treshold : 1;
var thisBitmap:BitmapData = new BitmapData(this._width, this._height, true, 0);
thisBitmap.draw(this);
var mcBitmap:BitmapData = new BitmapData(mc._width, mc._height, true, 0);
mcBitmap.draw(mc);
if (thisBitmap.hitTest(new Point(this._x, this._y), threshold, mcBitmap, new Point(mc._x, mc._y), threshold)) {
return true;
}
return false;
};
This is a REAL ACTUAL SHAPE COLLISION Unlike others... It took me too long to find it on the net... I hope you enjoy it!!
Don't forget to Subscribe!!