Mam następujący problem: chcę przyciszyć płynnie lub nie, już wszystko mi jedno dany utwór i uruchomić następny, mam je odpalone przez Action Script w trzech MC, korzystam z tego skryptu:
Kod
Sound.prototype.fadeIn = function (updateTime){
this._sndObj != undefined ? (clearInterval(this._sndObj), delete this._sndObj) : null;
this._sndObj = setInterval(function () {
var volume=arguments[0].getVolume();
volume < 100 ? arguments[0].setVolume(volume+1) : (clearInterval(arguments[0]._sndObj), delete arguments[0]._sndObj);
},updateTime,this);
}
Sound.prototype.fadeOut = function (updateTime){
this._sndObj != undefined ? (clearInterval(this._sndObj), delete this._sndObj) : null;
this._sndObj= setInterval(function () {
var volume=arguments[0].getVolume();
volume > 0 ? arguments[0].setVolume(volume-1) : (clearInterval(arguments[0]._sndObj), delete arguments[0]._sndObj);
}, updateTime,this);
}
ASSetPropFlags(Sound.prototype,["fadeIn","fadeOut"],1);
this._sndObj != undefined ? (clearInterval(this._sndObj), delete this._sndObj) : null;
this._sndObj = setInterval(function () {
var volume=arguments[0].getVolume();
volume < 100 ? arguments[0].setVolume(volume+1) : (clearInterval(arguments[0]._sndObj), delete arguments[0]._sndObj);
},updateTime,this);
}
Sound.prototype.fadeOut = function (updateTime){
this._sndObj != undefined ? (clearInterval(this._sndObj), delete this._sndObj) : null;
this._sndObj= setInterval(function () {
var volume=arguments[0].getVolume();
volume > 0 ? arguments[0].setVolume(volume-1) : (clearInterval(arguments[0]._sndObj), delete arguments[0]._sndObj);
}, updateTime,this);
}
ASSetPropFlags(Sound.prototype,["fadeIn","fadeOut"],1);
problem w tym, że zarówno ten kod, jak i zwykle setVolume działa tylko na jeden element jednocześnie - gdy chcę wykonać dwie czynności, jeden dźwięk wywalić w kosmos, a drugi odpalić, to efekt jest taki, że nic się nie dzieje, przy wyłączeniu/włączeniu jednego w sposób płynny powyższym skryptem jest OK, próbowałem nawet go do każdego MC wrzucić i nazwać inaczej wywołując inne funkcje, ale nic, tak jakby się nie dało kompletnie dwóch czynności na dźwiękach na raz wykonywać, serdecznie proszę o możliwie szybką pomoc, gdyż sprawa jest dosyć pilna...
pozdrawiam