
27.08.2002, 13:25
|
|
|
Сайгак
Регистрация: Mar 2001
Адрес: Киев
Сообщений: 1,834
|
в том смысле, что если в мувике объект поместить в точку 0,0 а сам мувик на сцене поместить в точку 100,100 то и объект относительно сцены будет лежать в точке 100,100
Когда я делал мувик ,который создавал текстовые поля и расчитывал их месторасположение в зависимости от размеров я просто кинул его в точку 0,0 на главную сцену. А по уму, есть комманда localToglobal и globalTolocal. Их нужно юзать, чтоб с координатами не мучаться!
MovieClip.globalToLocal
Availability
Flash Player 5.
Usage
myMovieClip.globalToLocal(point)
Parameters
point The name or identifier of an object created with the generic Object object specifying the and coordinates as properties.
Returns
Nothing.
Description
Method; converts the point object from Stage (global) coordinates to the movie clip's (local) coordinates.
Example
The following example converts the global and 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);
trace(_root._xmouse + " " + _root._ymouse);
trace(point.x + " " + point.y);
updateAfterEvent();
}
MovieClip.localToGlobal
Availability
Flash Player 5.
Usage
myMovieClip.localToGlobal(point)
Parameters
point The name or identifier of an object created with the Object object, specifying the and coordinates as properties.
Returns
Nothing.
Description
Method; converts the point object from the movie clip's (local) coordinates, to the Stage (global) coordinates.
Example
The following example converts and coordinates of the point object, from the movie clip's coordinates (local) to the Stage coordinates (global). The local and coordinates are specified using the _xmouse and _ymouse properties to retrieve the and coordinates of the mouse position.
onClipEvent(mouseMove) {
point = new object();
point.x = _xmouse;
point.y = _ymouse;
_root.out3 = point.x + " === " + point.y;
_root.out = _root._xmouse + " === " + _root._ymouse;
localToGlobal(point);
_root.out2 = point.x + " === " + point.y;
updateAfterEvent();
}
__________________
- Всё, мастер! Готово!
- Что готово?
- Сломал...
------------------------------
(O: ЖЖ :O)
Последний раз редактировалось ЛОWАДКА; 27.08.2002 в 13:27.
|