[AS 3] Simple Hit Test with hitTestPoint Method
No commentsDisplayObject.hitTestPoint(x:Number, y:Number, shapeFlag:Boolean = false)
This method is great for testing intersections with an X,Y point of the stage. Ideally you would use this with small objects to allow for a more realistic hit test.
I used my circle class from earlier.
package {
import flash.display.Sprite;
public class [...]
[AS 3] Simple Hit Test Class Using HitTestObject Method
No commentsThere are many levels of detection for testing whether one object is hitting (touching) another object. The most simple method is to use the hitTestObject method of Actionscript. This is a great method for renderings that will fit within a square/rectangular area, as you can see from the image that a circle’s area is defined [...]