有没有办法停止从flash_mp3_player的另一个播放器实例播放MP3?

问题描述 投票:0回答:1

那么这可能要问很多,但我一直试图这样做几个小时而且无法让它工作......

首先,我需要在我的网页上放置多个MP3播放器,所以我在http://flash-mp3-player.net/下载了播放器。我正在使用迷你和多版本......所以当迷你开始播放时,我想要多次关闭。

我认为最好的方法是修改flash文件以使用localConnection并触发stop函数但我根本无法访问stop函数...我的代码是这样的

在MINI模板类中:

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();
        }
    }

在模板MULTI中很好... 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工作,我也可以在listenLC块之外编写this.stopRelease() ....这有效,但是我无法从stopRelease()函数中访问stopPlayingPls函数。

哦,与this的痕迹返回undefined

flash mp3
1个回答
0
投票

如果您使用javascript,则浏览器可以与其他swf实例建立连接。继续您所在的路径,但利用Flash的本机能力在浏览器中分派和侦听JS事件。

© www.soinside.com 2019 - 2024. All rights reserved.