![]() |
|
||||||||||
|
|
|
|||||
|
Регистрация: Sep 2010
Адрес: Moscow
Сообщений: 473
|
picture.onRollOver=Over; picture.onRollOut=Out; var speed=5; _root.onEnterFrame = function() { picture._x+=speed; trace(speed); if(picture._x>0){picture._x=-2712} }; picture.onRollOver= function() {trace("good"); if(speed>=0){ speed-=0.2; } } picture.onRollOut= function() { trace("Bad"); if(speed<5){ speed+=0.2; } if(speed>5){ speed=5; } } |
|
|||||
|
Регистрация: Sep 2010
Адрес: Moscow
Сообщений: 473
|
var speed=5; //скорость _root.onEnterFrame = function() { picture._x+=speed; //постоянное перемещение объекта }; picture.onRollOver= function() { if(speed>=0){ speed-=0.2; //при наведении если скорость больше нуля то уменьшить ее } } picture.onRollOut= function() { if(speed<5){ speed+=0.2; } if(speed>5){ //при убирании мышки с объекта если скорость больше 5 то установить в 5 // если меньше 5 то прибавить к скорости speed=5; } } |
|
|||||
var speed:Number = 5; picture.onRollOver = Over; picture.onRollOut = Out; function Over() { onEnterFrame = motionOver } function Out() { onEnterFrame = motionOut } function motionOver() { picture._x += speed; if(speed>=0){ speed-=0.2; } } function motionOut() { picture._x += speed; if(speed<5){ speed+=0.2; } if(speed>5){ speed=5; } } |
|
|||||
|
Регистрация: Sep 2010
Адрес: Moscow
Сообщений: 473
|
все)спасибо)я сделал через флаг
|
![]() |
![]() |
Часовой пояс GMT +4, время: 21:38. |
|
|
« Предыдущая тема | Следующая тема » |
|
|