Показать сообщение отдельно
Старый 18.07.2009, 12:51
iNils вне форума Посмотреть профиль Отправить личное сообщение для iNils Посетить домашнюю страницу iNils Найти все сообщения от iNils
  № 8  
Ответить с цитированием
iNils
Негуру
 
Аватар для iNils

администратор
Регистрация: Jan 2000
Адрес: Кёнигсберг in Moscow
Сообщений: 21,884
Записей в блоге: 7
Код AS1/AS2:
this.createEmptyMovieClip ("frontSound", this.getNextHighestDepth ());
var snd:Sound = new Sound (this.frontSound);
snd.attachSound ("snd");
///
this.createEmptyMovieClip ("bgSound", this.getNextHighestDepth ());
var music:Sound = new Sound (this.bgSound);
music.attachSound ("music");
///
btn_mc.gotoAndPlay (2);
music.start (0, 99999);
music.onSoundComplete = function () {
	this.start (0, 99999);
};
///
var flagMute:Boolean = false;
var interval:Number
///
btn_mc.onRelease = function () {
	clearInterval (interval);
	if (flagMute) {
		interval = setInterval (soundOff, 50, 10);
		this.gotoAndPlay (2);
	} else {
		interval = setInterval (soundOn, 50, 10);
		this.gotoAndPlay (7);
	}
	flagMute = !flagMute;
};
function soundOff (varDelta:Number) {
	music.setVolume (music.getVolume () - 5);
	if (music.getVolume () <= varDelta) {
		clearInterval (interval);
		music.setVolume (0);
	}
}
function soundOn (varDelta:Number) {
	music.setVolume (music.getVolume () + varDelta);
	if (music.getVolume () >= 100) {
		clearInterval (interval);
		music.setVolume (100);
	}
}
__________________
(и)Нильс.ru | Плагины для FlashDevelop