
Код:
//Начальная позиция мувика
var initPosX:Number = movie._x;
var initPosY:Number = movie._y;
//Сдвиг в пикселях
var k:Number = 10;
movie.onRollOver = function() {
//Эффект дрожания
this.onEnterFrame = function() {
this._x = Math.floor(Math.random()*k+initPosX);
this._y = Math.floor(Math.random()*k+initPosY);
};
};
movie.onRollOut = function() {
//Возвражаем мувик в начальную позицию
this._x = initPosX;
this._y = initPosY;
//и удаляем onEnterFrame
delete this.onEnterFrame;
};