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

блогер
Регистрация: Mar 2008
Адрес: Днепропетровск
Сообщений: 1,783
Записей в блоге: 3
Попробовал сделать по другому, стало быстрее работать, но 1100 всё таки не потянет
Код AS1/AS2:
import mx.transitions.Tween;
import mx.transitions.easing.*;
 
var scale = 20;//расстояние между клетками
for (var i = 0; i < 25; i++) {
	for (var j = 0; j < 25; j++) {
		var c = _root.attachMovie("clip", i + "_" + j, _root.getNextHighestDepth());
		c._x = 10 + j * scale;
		c._y = 10 + i * scale;
 
		c.posX = c._x;
		c.posY = c._y;
	}
}
fps.swapDepths(_root.getNextHighestDepth())
_root.onMouseMove = function() {
 
	var mJ = Math.floor(_xmouse / scale);
	var mI = Math.floor(_ymouse / scale);
 
	for (var tempI = mI - 1; tempI <= mI + 1; tempI++) {
		for (var tempJ = mJ - 1; tempJ <= mJ + 1; tempJ++) {
			var tc:String = tempI + "_" + tempJ;
 
			_root[tc].tw.stop()
			_root[tc].tb.stop();
 
 
			_root[tc].tw = new Tween(_root[tc], "_x", Regular.easeOut, _root[tc]._x, _root[tc]._x + random(60) - 30,5);
			_root[tc].tw = new Tween(_root[tc], "_y", Regular.easeOut, _root[tc]._y, _root[tc]._y + random(60) - 30, 5);
			_root[tc].tw = new Tween(_root[tc], "_rotation", Regular.easeOut, _root[tc]._rotation, random(360), 5);
			_root[tc].tw.onMotionFinished = function() {
				this.obj.tb = new Tween(this.obj, "_x", Regular.easeOut, this.obj._x, this.obj.posX, 5);
				this.obj.tb = new Tween(this.obj, "_y", Regular.easeOut, this.obj._y, this.obj.posY, 5);
				this.obj.tb = new Tween(this.obj, "_rotation", Elastic.easeOut, this.obj._rotation, 0, 5);
 
			};
		}
	}
 
};
Вложения
Тип файла: swf moveAll_test.swf (6.1 Кб, 52 просмотров)