Тема: Алгоритмы Функция в цикле
Показать сообщение отдельно
Старый 22.04.2014, 14:55
in4core вне форума Посмотреть профиль Отправить личное сообщение для in4core Найти все сообщения от in4core
  № 2  
Ответить с цитированием
in4core
 
Аватар для in4core

Регистрация: Mar 2009
Сообщений: 4,219
Записей в блоге: 14
Код AS3:
for(i = 0; i < Fact.length; i++)
{
	this.Fact[i].visible = true;
 
	Fact[i].addEventListener(MouseEvent.MOUSE_DOWN, fun1);
        Fact[i].addEventListener(MouseEvent.MOUSE_UP, fun2);
 
}
function fun1 (event:MouseEvent):void
	{
		e.currentTarget.startDrag();
 
	}
 
 
	function fun2 (event:MouseEvent):void
	{
 
		if(e.currentTarget.hitTestObject(frame_01))
			{
				e.currentTarget.x = 158;
				e.currentTarget.y = 88;
			}
			e.currentTarget.stopDrag();
 
	}
__________________
Марк Tween