Max-Mov > MovieClip.globalToLocal

MovieClip.globalToLocal

Syntax

anyMovieClip.globalToLocal(point); 

Arguments

point The name or identifier of an object created with the generic Object object specifying the x and y coordinates as properties.

Description

Method; converts the point object from Stage (global) coordinates to the movie clip's (local) coordinates.

Player

Flash 5 or later.

Example

The following example converts the global x and y coordinates of the point object to the local coordinates of the movie clip:

onClipEvent(mouseMove) {
	point = new object();
	point.x = _root._xmouse;
	point.y = _root._ymouse;
	globalToLocal(point);
	_root.out = _xmouse + " === " + _ymouse;
	_root.out2 = point.x + " === " + point.y;
	updateAfterEvent();
}

See also

MovieClip.localToGlobal
MovieClip.getBounds