Показать сообщение отдельно
Старый 03.06.2008, 08:48
Vektor вне форума Посмотреть профиль Отправить личное сообщение для Vektor Найти все сообщения от Vektor
  № 9  
Ответить с цитированием
Vektor
 
Аватар для Vektor

Регистрация: May 2008
Адрес: Новокузнецк
Сообщений: 219
Записей в блоге: 1
Немного изменил код, так правильней.
Код:
//звуки добавиш сам, не забуть в Properties звука поставить галочку, как для Мувика. 
//Названия звука 1-9.
var aSound:Array = ["1", "2", "3", "4", "5", "6", "7", "8", "9"];
var nS:Number;
this.onMouseDown = function() {
	var mySound:Sound = new Sound();
	nS = Math.floor(Math.random()*aSound.length);
	mySound.attachSound(aSound[nS]);
	mySound.start();
	aSound.splice(nS,1);
	var _interval = setInterval(fSound, mySound.duration);
	function fSound() {
		nS = Math.floor(Math.random()*aSound.length);
		mySound.attachSound(aSound[nS]);
		mySound.start();
		aSound.splice(nS,1);
		if (aSound.length == 0) {
			clearInterval(_interval);
			_interval = null;
		}      
	}
};
__________________
Книги и желание лучшие учителя.


Последний раз редактировалось Vektor; 03.06.2008 в 08:52.