Показать сообщение отдельно
Старый 13.02.2007, 22:22
sokiche вне форума Посмотреть профиль Отправить личное сообщение для sokiche Посетить домашнюю страницу sokiche Найти все сообщения от sokiche
  № 1  
Ответить с цитированием
sokiche
 
Аватар для sokiche

Регистрация: Feb 2007
Сообщений: 19
Question Цикл for и что-то необъяснимое

trace (counter) при клике всегда выдает 4...
почему???
и как заставить выдавать 1 при клике по первому, 2 по второму и т.д.?
Код:
for (counter = 1; counter <= 3; counter++) {
	currentImgBut = "imgBut" + counter;
	_root.imageNum.attachMovie("imgBut", currentImgBut, _root.imageNum.getNextHighestDepth());
	_root.imageNum[currentImgBut].imgNumText.text = counter;
	_root.imageNum[currentImgBut]._x = _root.imageNum[currentImgBut]._width * counter;
	_root.imageNum[currentImgBut].onRelease = function () {
		//_root.galleryLoader.loadClip (counter + ".jpg", _root.galleryImages);
		trace (counter);
	}
}