Показать сообщение отдельно
Старый 11.02.2006, 03:13
Король вне форума Посмотреть профиль Отправить личное сообщение для Король Найти все сообщения от Король
  № 3  
Ответить с цитированием
Король
 
Аватар для Король

Регистрация: Oct 2003
Адрес: Москва
Сообщений: 2,736
Отправить сообщение для Король с помощью ICQ
Код:
MovieClip.prototype.slideTo = function(x, y, speed, onComplete) {
	this.x = x;
	this.controller = this.createEmptyMovieClip("controller", 1);
	this.onComplete = onComplete;
	this.controller.trg = this;
	this.y = y;
	this.speed = speed;
	this.controller.onEnterFrame = function() {

		this.trg._x += (this.trg.x-this.trg._x)/this.trg.speed;
		this.trg._y += (this.trg.y-this.trg._y)/this.trg.speed;
		if (Math.abs(this.trg._x-this.trg.x)<2 && Math.abs(this.trg._y-this.trg.y)<2) {
			delete this.onEnterFrame;
			this.trg._x = x;
			this.trg._y = y;
			this.trg.onComplete();
		}
	};
};
image.onEnterFrame = function() {
	this.slideTo(_root._xmouse, this._y, 3);
};


Последний раз редактировалось Король; 11.02.2006 в 03:17.