De-I > _droptarget
_droptargetSyntax
draggableInstanceName
._droptarget
Arguments
draggableInstanceName
The name of a movie clip instance that was the target of a startDrag
action.
Description
Property (read-only); returns the absolute path in slash syntax notation of the movie clip instance on which the draggableInstanceName
was dropped. The _droptarget
property always returns a path that starts with /
. To compare the _droptarget
property of an instance to a reference, use eval
to convert the returned value from slash syntax to a reference.
Player
Flash 4 or later.
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;
See also
startDrag