Показать сообщение отдельно
Старый 16.04.2010, 14:11
samana вне форума Посмотреть профиль Отправить личное сообщение для samana Найти все сообщения от samana
  № 4  
Ответить с цитированием
samana
 
Аватар для samana

блогер
Регистрация: Mar 2008
Адрес: Днепропетровск
Сообщений: 1,783
Записей в блоге: 3
Может как то так:
Код AS1/AS2:
import mx.transitions.Tween;
import mx.transitions.easing.*;
for (var i = 0; i < 5; i++) {
	for (var j = 0; j < 5; j++) {
		var p = _root.attachMovie("clip", "clip" + i + j, _root.getNextHighestDepth());
		p._x = 40 + j * 40;
		p._y = 40 + i * 40;
		p.startX = p._x;
		p.startY = p._y;
		p.go = false;
		p.onMouseMove = function() {
			this.dis = Math.sqrt(Math.pow(_xmouse - this.startX, 2) + Math.pow(_ymouse - this.startY, 2));
			if (this.dis < 50 && this.go == false) {
				this.go = true;
				this.tx.stop();
				this.ty.stop();
				this.rot.stop();
				this.tx = new Tween(this, "_x", Elastic.easeOut, this._x, this.startX + random(100) - 50, 50);
				this.ty = new Tween(this, "_y", Elastic.easeOut, this._y, this.startY + random(100) - 50, 50);
				this.rot = new Tween(this, "_rotation", Elastic.easeOut, this._rotation, random(360), 50);
 
			}
			if (this.dis > 50) {
				this.go = false;
				this.tx.stop();
				this.ty.stop();
				this.rot.stop();
				this.tx = new Tween(this, "_x", Regular.easeOut, this._x, this.startX, 10);
				this.ty = new Tween(this, "_y", Regular.easeOut, this._y, this.startY, 10);
				this.rot = new Tween(this, "_rotation", Regular.easeOut, this._rotation, 0, 10);
 
			}
		};
 
	}}
Вложения
Тип файла: swf tests.swf (3.6 Кб, 87 просмотров)


Последний раз редактировалось samana; 16.04.2010 в 17:32.