MovieClip._droptarget

Availability

Flash Player 4.

Usage

my_mc._droptarget

Description

Property (read-only); returns the absolute path in slash syntax notation of the movie clip instance on which my_mc 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.

Note: You must perform this conversion if you are using ActionScript 2.0, which does not support slash syntax.

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 SWF file with the following script:

x_pos = garbage._x;
y_pos = garbage._y;

See also

startDrag()