Здравствуйте.
Есть внешний прелоадер и есть загружающийся fla файл в котором следующий код.
Вначале звука через прелоадер вообще не было.
Долго ползал по инету пока не нашёл, что чтобы загружать через прелоадер в загружающемся файле надо изменить
Код AS1/AS2:
var s_sound = new Sound();
на
Код AS1/AS2:
var s_sound = new Sound(this);
А вот с остальным кодом засада.
С прелоадером не работает плавный fade in и не работают кнопки "mute"
Пожалуйста, подскажите, что поправить в коде, так как флеш я почти вообще не знаю.
Спасибо!!!!!
Код AS1/AS2:
function soundOff_func(varDelta)
{
_root.s_sound.setVolume(_root.s_sound.getVolume() - 10);
if (_root.s_sound.getVolume() <= varDelta)
{
clearInterval(_root.sound_int);
_root.s_sound.setVolume(0);
} // end if
} // End of the function
function soundOn_func(varDelta)
{
_root.s_sound.setVolume(_root.s_sound.getVolume() + varDelta);
if (_root.s_sound.getVolume() >= 100)
{
clearInterval(_root.sound_int);
_root.s_sound.setVolume(100);
} // end if
} // End of the function
stop ();
var s_sound = new Sound(this);
s_sound.attachSound("music.wav");
s_sound.start(0, 99999);
s_sound.onSoundComplete = function ()
{
this.start(0, 99999);
};
_root.s_sound.setVolume(0);
_root.sound_int = setInterval(_root.soundOn_func, 10, 1);
btn_mc.onRelease = function ()
{
clearInterval(_root.sound_int);
if (_root.s_sound.getVolume() < 100)
{
_root.sound_int = setInterval(_root.soundOn_func, 50, 10);
this.gotoAndStop(1);
}
else
{
_root.sound_int = setInterval(_root.soundOff_func, 50, 10);
this.gotoAndStop(2);
} // end else if
};