Hitarea (Movieclip.hitarea Property); Hittest (Movieclip.hittest Method) - MACROMEDIA FLASH 8-FLASH LITE 2.X ACTIONSCRIPT LANGUAGE Reference

Flash lite 2.x actionscript language reference
Hide thumbs Also See for FLASH 8-FLASH LITE 2.X ACTIONSCRIPT LANGUAGE:
Table of Contents

Advertisement

hitArea (MovieClip.hitArea property)

public hitArea :
Designates another movie clip to serve as the hit area for a movie clip. If the
does not exist or is
null
of the
property may be a reference to a movie clip object.
hitArea
You can change the
hitArea
on 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
read out of a prototype object.
Availability: ActionScript 1.0; Flash Lite 2.0
Example
The following example sets the
clip. Place these two movie clips on the Stage and test the document. When you click
, the
circle_mc
square_mc
square_mc.hitArea = circle_mc;
square_mc.onRelease = function() {
trace("hit! "+this._name);
};
You can also set the
circle_mc
.
square_mc
circle_mc._visible = false;
See also

hitTest (MovieClip.hitTest method)

hitTest (MovieClip.hitTest method)
public hitTest() : Boolean
Evaluates the movie clip to see if it overlaps or intersects with the hit area that the
and
coordinate parameters identify.
y
Usage 1: Compares the x and y coordinates to the shape or bounding box of the specified
instance, according to the
actually occupied by the instance on the Stage is evaluated, and if x and y overlap at any point,
a value of
is returned. This evaluation is useful for determining if the movie clip is
true
within a specified hit or hotspot area.
480
ActionScript classes
Object
or
, the movie clip itself is used as the hit area. The value
undefined
property at any time; the modified movie clip immediately takes
circle_mc
movie clip traces that it was clicked.
movie clip
setting. If
shapeFlag
movie clip as the hit area for the
property to
visible
is set to
shapeFlag
property
hitArea
property can be
hitArea
square_mc
to hide the hit area for
false
target
, only the area
true
movie
or
x

Advertisement

Table of Contents
loading

Table of Contents