Wrox Home  
Search P2P Archive for: Go

  Return to Index  

flash_programming thread: hit area


Message #1 by "Tyrel Souza" <tyrel_34@h...> on Sun, 29 Dec 2002 02:05:35
ooh or you can just edit the test grey thingy in the button timeline, it 
is the fourth field/frame









> You can try to type hitTest in index search inside
Flash.
Hope it helps

Availability

Flash Player 5.

Usage

myMovieClip.hitTest(x, y, shapeFlag)
myMovieClip.hitTest(target)

Parameters

x The coordinate of the hit area on the Stage.

y The coordinate of the hit area on the Stage.

The and coordinates are defined in the global
coordinate space.

target The target path of the hit area that may
intersect or overlap with the instance specified by
MovieClip. The target usually represents a button or
text-entry field.

shapeFlag A Boolean value specifying whether to
evaluate the entire shape of the specified instance
(true), or just the bounding box (false). This
parameter can only be specified if the hit area is
identified using x and y coordinate parameters.

Returns

Nothing.

Description

Method; evaluates the instance specified by MovieClip
to see if it overlaps or intersects with the hit area
identified by the target or x and y coordinate
parameters.

Usage 1: Compares the x and y coordinates to the shape
or bounding box of the specified instance, according
to the shapeFlag setting. If shapeFlag is set to true,
only the area actually occupied by the instance on the
Stage is evaluated, and if x and y overlap at any
point, a value of true is returned. This is useful for
determining if the movie clip is within a specified
hit or hotspot area. 

Usage 2: Evaluates the bounding boxes of the target
and specified instance, and returns true if they
overlap or intersect at any point.

Example

The following example uses hitTest with the x_mouse
and y_mouse properties to determine whether the mouse
is over the target's bounding box:

if (hitTest( _root._xmouse, _root._ymouse, false));

The following example uses hitTest to determine if the
movie clip ball overlaps or intersects with the movie
clip square:> where is hitTest
> 
> ---
> Change your mail options at
> http://p2p.wrox.com/manager.asp or 
> to unsubscribe send a blank email to
 

_________________________________________________________
Lonely Christmas(陳奕迅),風箏與風(Twins),無間道(電影)...
至In手機鈴聲 陪你過冬天
http://ringtone.yahoo.com.hk

  Return to Index