
26.12.2002, 23:06
|
|
|
Ветеран форума
Регистрация: Jul 2001
Адрес: Москва
Сообщений: 3,088
|
вот не поленился... (незнаю только зачем) открыл значится хелп который с флешем даётся... и что же мы там видим?
MovieClip.hitTest
Availability
Flash Player 5.
Usage
myMovieClip.hitTest(x, y, shapeFlag)
myMovieClip.hitTest(target)
Parameters
x The x coordinate of the hit area on the Stage.
y The y coordinate of the hit area on the Stage.
The x and y 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:
if(_root.ball, hittest(_root.square)){
trace("ball intersects square");
}
а потом решил а почему бы ещё не посмотреть... и что же я там ещё нашёл?
MovieClip._droptarget
Availability
Flash Player 4.
Usage
myMovieClip._droptarget
Description
Property (read-only); returns the absolute path in slash syntax notation of the movie clip instance on which the MovieClip was dropped. The _droptarget property always returns a path that starts with a slash (/). To compare the _droptarget property of an instance to a reference, use the eval function to convert the returned value from slash syntax to a dot syntax reference.
Example
The following example evaluates the _droptarget property of the garbage movie clip instance and uses eval to convert it from slash syntax to a dot syntax reference. The garbage reference is then compared to the reference to the trash movie clip instance. If the two references are equivalent, the visibility of garbage is set to false. If they are not equivalent, the garbage instance is reset to its original position.
if (eval(garbage._droptarget) == _root.trash) {
garbage._visible = false;
} else {
garbage._x = x_pos;
garbage._y = y_pos;
}
The variables x_pos and y_pos are set on Frame 1 of the movie with the following script:
x_pos = garbage._x;
y_pos = garbage._y;
Последний раз редактировалось nagash; 26.12.2002 в 23:08.
|