再生/未再生の曲のアーティスト名とタイトルを記録するように、 Storm Flash MP3プレーヤーを変更しようとしています。作成者は、IO エラーが発生した場合に曲をスキップするようにプレーヤーを更新しました。以下のコードを見つけましたが、再生された曲で機能します。なぜか、IOError 関数に追加すると、まったく機能しません。
Flashに関しては初心者です。どんな助けでも大歓迎です。
//Record Played Song Info via PHP script
scriptVars.var1 = "1+" + String(aMP3Tracks[iCurrTrack][1] + "+" + aMP3Tracks[iCurrTrack][2]);
scriptVars.var2 = (scriptDate);
scriptRequest.method = URLRequestMethod.POST;
scriptRequest.data = scriptVars;
scriptLoader.load(scriptRequest);
//End of Record Played Song Info via PHP script
再生機能
function playMP3():void {
tMP3Transform.volume = nCurrVolume;
schMP3 = sMP3.play();
schMP3.soundTransform = tMP3Transform;
**//Record Played Song Info via PHP script
scriptVars.var1 = "1+" + String(aMP3Tracks[iCurrTrack][1] + "+" + aMP3Tracks[iCurrTrack][2]);
scriptVars.var2 = (scriptDate);
scriptRequest.method = URLRequestMethod.POST;
scriptRequest.data = scriptVars;
scriptLoader.load(scriptRequest);
//End of Record Played Song Info via PHP script**
if(mcStormHolder.mcPlayBtn.currentFrame >= 20) {
schMP3.stop();
}
schMP3.addEventListener(Event.SOUND_COMPLETE, incrementTrack, false, 0, true);
removeEventListener(Event.ENTER_FRAME, updateViz);
bForceRandom = false;
addEventListener(Event.ENTER_FRAME, updateViz, false, 0, true);
}
IOERROR 関数
function onMP3IOError(e:IOErrorEvent):void {
trace("An IO error occurred while attempting to load the MP3 track.");
//sMP3.removeEventListener(Event.COMPLETE, onMP3Loaded);
sMP3.removeEventListener(IOErrorEvent.IO_ERROR, onMP3IOError);
sMP3.removeEventListener(SecurityErrorEvent.SECURITY_ERROR, onMP3SecurityError);
//incrementTrack();
mcStormHolder.mcInfoBar.txInfo.text = String(aMP3Tracks[iCurrTrack][1] + " - " + aMP3Tracks[iCurrTrack][2]);
mcStormHolder.mcInfoBar.txInfo.autoSize = TextFieldAutoSize.LEFT;
mcStormHolder.mcInfoBar.txInfo.x = 50;
//Record Song if for songs that did not play
scriptVars.var1 = "0+" + String(aMP3Tracks[iCurrTrack][0]);
scriptVars.var2 = (scriptDate);
scriptRequest.method = URLRequestMethod.POST;
scriptRequest.data = scriptVars;
scriptLoader.load(scriptRequest);
//Record Song if for songs that did not play
//Begin Modification for Roger Stull - Skip song if will not load
abortLoad();
bForceRandom = false;
if (schMP3 != null) {
schMP3.stop();
schMP3.removeEventListener(Event.SOUND_COMPLETE, incrementTrack);
nPausePos = 0;
iCurrTrack = iCurrTrack + 1;
if(iCurrTrack > iNumTracks-1){
iCurrTrack = 0;
}
sMP3 = new Sound();
schMP3 = new SoundChannel();
loadMP3();
}
//End Modification for Roger Stull
}