Layer.onHitTest

Function/Meaning

collision detection

Type
LayerclassEvent
Syntax
onHitTest(x, y, hit)
Arguments
x

The x coordinate (within the display coordinates of the layer) of the position where collision detection is performed.

y

The y coordinate (within the display coordinates of the layer) at the position where collision detection is performed.

hit

As a result of the hit judgment, if it is hit, it will be true, and if it is not, it will be false.
Pass the collision result to this argument of the superclass event of the same name.

Return value
None (void)
Explanation

Called when a collision detection (hit test) is performed on a point in the layer.
For the result of the collision detection, pass the result of the collision detection to the third argument of this event of the superclass (pass the first argument and the second argument as they are).
As a result of collision detection, if it hits, the mouse message becomes opaque and processed in that layer.
If not hit, it will be transparent and the mouse message will be processed in a deeper layer.
This event is called after the collision detection performed by Layer.hitThreshold and Layer.hitType determines that it is "hit".
Therefore, this event will not be called if the Layer.hitThreshold or Layer.hitType determines that it is "not hit".