Description
Property; designates another movie clip to serve as the hit area for a movie clip. If the
property does not exist or is
value of the
hitArea
You can change the
the new hit area behavior. The movie clip designated as the hit area does not need to be visible; its
graphical shape, although not visible, is hit-tested. The
prototype object.
Example
The following example sets the
clip. Place these two movie clips on the Stage and test the document. When you click
the
movie clip traces that it has been clicked.
square_mc
square_mc.hitArea = circle_mc;
square_mc.onRelease = function() {
trace("hit! "+this._name);
};
You can also set the
.
square_mc
circle_mc._visible = false;
See Also
MovieClip.hitTest()
MovieClip.hitTest()
Availability
Flash Player 5.
Usage
my_mc.hitTest(x:Number, y:Number, shapeFlag:Boolean) : Boolean
my_mc.hitTest(target:Object) : Boolean
Parameters
The x coordinate of the hit area on the Stage.
x
The y coordinate of the hit area on the Stage.
y
The x and y coordinates are defined in the global coordinate space.
The target path of the hit area that may intersect or overlap with the instance specified
target
by
. The
my_mc
target
A Boolean value specifying whether to evaluate the entire shape of the specified
shapeFlag
instance (
), or just the bounding box (
true
area is identified using
586
Chapter 7: ActionScript for Flash
or
null
undefined
property may be a reference to a movie clip object.
property at any time; the modified movie clip immediately takes on
hitArea
circle_mc
movie clip
circle_mc
parameter usually represents a button or text-entry field.
and
coordinate parameters.
x
y
, the movie clip itself is used as the hit area. The
hitArea
movie clip as the hit area for the
property to
visible
false
). This parameter can be specified only if the hit
false
hitArea
property can be read out of a
square_mc
circle_mc
to hide the hit area for
movie
,
Need help?
Do you have a question about the FLEX-FLEX ACTIONSCRIPT LANGUAGE and is the answer not in the manual?