The concepts for this type of hitTest are all in AS: Main, but i figure i could combine a few to create a neat hitTest. I will show you how to create a hitTest between a circle and any other shape. It will involve a loop and some simple trig. So, first set up your radius variables in an onLoad handler.
radius= ###
Make radius whatever the radius of your circle may be. Next we will crate the loop.
for (=0; i<360; i++) {
This loop is going to be used for your angle. Since a cirlce has 360 degrees, you want the loop to be 360 in order to cover the entire circle.
X = (Math.cos(i*(Math.PI/180))*radius)+_x;
Y = (Math.sin(i*(Math.PI/180))*radius)+_y;
This will calculate the _x and _y components of the entire 360 degree angle for your circle. As you will see, the angle in the script is represented by the loop variable. Next is the hitTest.
if (_root.shape.hitTest(X, Y, true)) {
_root.shape is the movie clip that you would want to preform the hitTest with. Here is the full script:
onClipEvent (load) {
radius = ###
}
onClipEvent (enterFrame) {
for (i=0; i<360; i++) {
X = (Math.cos(i*(Math.PI/180))*radius)+_x;
Y = (Math.sin(i*(Math.PI/180))*radius)+_y;
if (_root.shape.hitTest(X, Y, true)) {
trace("hit")
}
}
}
And there you have it. Short and simple, but hopefuly someone out there will find it at least slightly useful. And if not, then at least i finally made an AS topic of my own. Its getting hard to make them, most topics have been gone through already.