嗯,這可能是很多要問在這裏,但我一直試圖做幾個小時,並不能得到它的工作....請幫助。有沒有辦法停止從flash_mp3_player的其他播放器實例播放mp3?
首先,我需要把多個MP3播放器在我的網頁,所以我下載的播放器在http://flash-mp3-player.net/。我正在使用迷你版和多版本...所以,當迷你開始播放時,我想多關閉。
我認爲最好的辦法是修改的Flash文件使用的localConnection並觸發停止功能,但我不能在所有訪問停止功能...我的代碼是這樣的
在Mini templateA類:
public function playRelease()
{
trace("playing clicked....test");
var talkingLC:LocalConnection = new LocalConnection();
talkingLC.send("simpleRequest_lc", "stopPlayingPls");
this.player.play();
if (this.player.getLoading().percent != 100) {
this.startLoading();
}
}
而且在模板多的好... TemplateMulti.as構造:
var listeningLC:LocalConnection = new LocalConnection();
listeningLC.stopPlayingPls = function() {
trace("Execute stopping routine "+this.parent._width);
trace(MovieClip[this.parent]);
/*stopRelease();
super.stopRelease();
this._enableButton(this._stopButtonInstance, false);
this._enableButton(this._pauseButtonInstance, false, true);
this._enableButton(this._playButtonInstance, true);
delete this._sliderInstance.onEnterFrame;
this._sliderInstance.bar_mc._x = 0;
this.updatePlaylist();*/
};
listeningLC.connect("simpleRequest_lc");
現在我可以同時獲得的痕跡,這意味着使用LocalConnection工作了,我也可以寫this.stopRelease()
的listeningLC塊....這外面的工作,但我不能從stopPlayingPls
函數中訪問stopRelease()
功能。
哦,與this
回報undefined
跟蹤.....任何想法嗎?