![]() |
|
||||||||||
|
|||||||
|
|
« Предыдущая тема | Следующая тема » |
| Опции темы | Опции просмотра |
|
![]() |
|
|||||
|
Регистрация: Mar 2004
Адрес: Украина, Винница
Сообщений: 4
|
У меня есть скрип написаный в мувиклипе Angel вида :
onClipEvent (enterFrame) { speed = 8; Spot_x = _root._xmouse; Spot_y = _root._ymouse; delta_x = _x - Spot_x; delta_y = _y - Spot_y; targetRotation = -Math.atan2(delta_x, delta_y)/(Math.PI/180); // move beetle toward the target and stop when it gets there if (Math.sqrt((delta_x*delta_x)+(delta_y*delta_y))>(speed+4)) { _y -= speed*Math.cos(targetRotation*(Math.PI/180)); _x += speed*Math.sin(targetRotation*(Math.PI/180)); }; play(); } Я хочу записать все скрипты в первом фрейме головной сцены попробывал исправить пути в обработчиках на абсолютные. зделал это примерно так запихнул в первый фрейм отдельного слоя головной сцены скрипт в таком виде Angel.onEnterFrame = function { speed = 8; Spot_x = _root._xmouse; Spot_y = _root._ymouse; delta_x = Angel._x - Spot_x; delta_y = Angel._y - Spot_y; targetRotation = -Math.atan2(delta_x, delta_y)/(Math.PI/180); // calculate the two methods of rotation // // move beetle toward the target and stop when it gets there if (Math.sqrt((delta_x*delta_x)+(delta_y*delta_y))>(speed+4)) { Angel._y -= speed*Math.cos(targetRotation*(Math.PI/180)); Angel._x += speed*Math.sin(targetRotation*(Math.PI/180)); }; play(); } При попытке запустить ролик выдаётся ошибка Scene=Scene 1, Layer=Layer 29, Frame=1: Line 1: Function name expected Angel.onEnterFrame = function { знаю ошибку допустил елементарную, но как прописывать абсолютные пути на обработчик нигде в книгах найти не могу, ПОМОГИТЕ ПОЖАЛУЙСТА или дайте ссылки на литературу ! Заранее спасибо |
![]() |
Часовой пояс GMT +4, время: 23:22. |
|
|
« Предыдущая тема | Следующая тема » |
|
|