【问题标题】:preloader another swf with preloader使用预加载器预加载另一个 swf
【发布时间】:2013-09-17 13:43:39
【问题描述】:

我需要打开“game.swf”

之前我用这个swf打开,叫做“loadgame.swf”(从游戏网站flashgame.com/loadgame.swf下载)

        this.Chargeur = new Loader();
        Security.allowDomain("*");
        this._C._B.width = 1;//this part of the loading animation
        this.Chargeur.contentLoaderInfo.addEventListener(Event.COMPLETE, this.Chargement_Ok);//this part of the preloader
        this.Chargeur.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, this.Chargement_EnCours);//this part of the preloader
        addChild(this.Chargeur);
        this.Chargeur.load(new URLRequest("flashgame.com/game.swf"));
        return;


    public function Chargement_Ok(event:Event) : void
    {
        this.Chargeur.contentLoaderInfo.removeEventListener(Event.COMPLETE, this.Chargement_Ok);//this part of the preloader
        this.Chargeur.contentLoaderInfo.removeEventListener(ProgressEvent.PROGRESS, this.Chargement_EnCours);//this part of the preloader
        this.Charge = 0;//this part of the preloader
        this.pregame = DisplayObject(this.Chargeur.contentLoaderInfo.content);                  //This is part of additional functions that I put in the game
        Loader(this.pregame.getChildAt(0)).contentLoaderInfo.addEventListener(Event.COMPLETE, this.gameInserido);   //This is part of additional functions that I put in the game
        this.BtcPlugin.addEventListener(MouseEvent.MOUSE_DOWN, this.Funcgame);                  //This is part of additional functions that I put in the game
        removeChild(this._C);//this part of the loading animation
        return;
    }// end function

我直接从我的电脑上穿了这个loadgame.swf来访问游戏....目前游戏不再接受它了。

但是我可以通过这种方式访问​​游戏:

        this.Chargeur = new Loader();
        Security.allowDomain("*");
        this._C._B.width = 1;//this part of the loading animation
        this.Chargeur.contentLoaderInfo.addEventListener(Event.COMPLETE, this.Chargement_Ok);//this part of the preloader
        this.Chargeur.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, this.Chargement_EnCours);//this part of the preloader
        addChild(this.Chargeur);
        this.Chargeur.load(new URLRequest("flashgame.com/loadgame.swf")); //(the online version it loads game.swf, but without the additional functions)
        return;

    public function Chargement_Ok(event:Event) : void
    {
        this.Chargeur.contentLoaderInfo.removeEventListener(Event.COMPLETE, this.Chargement_Ok);//this part of the preloader
        this.Chargeur.contentLoaderInfo.removeEventListener(ProgressEvent.PROGRESS, this.Chargement_EnCours);//this part of the preloader
        this.Charge = 0;//this part of the preloader
        this.pregame = DisplayObject(this.Chargeur.contentLoaderInfo.content);                  //stopped working
        Loader(this.pregame.getChildAt(0)).contentLoaderInfo.addEventListener(Event.COMPLETE, this.gameInserido);   //stopped working
        this.BtcPlugin.addEventListener(MouseEvent.MOUSE_DOWN, this.Funcgame);                  //stopped working
        removeChild(this._C);//this part of the loading animation
        return;
    }// end function

通过访问“http://www.flashgame.com/loadgame.swf”,我正在访问我的“loadgame.swf”的副本,但没有附加功能。

其实我需要,

this.Chargeur.load(new URLRequest("flashgame.com/loadgame.swf"));   
//(game.swf will be open within that swf)
this.Chargeur.contentLoaderInfo.addEventListener(Event.COMPLETE, this.Chargement_Ok);
//(Load only when Chargeur open game.swf completely)

如果有人愿意帮助我谢谢...

【问题讨论】:

    标签: flash preloader actionscript-3 fla


    【解决方案1】:

    您的应用程序域可能是问题所在。

    试试这样:

    var _urlRequest:URLRequest = new URLRequest(“mySecondarySwf.swf”);
    var _loader:Loader = new Loader();
    var _lc:LoaderContext = new LoaderContext(false, ApplicationDomain.currentDomain, null);
    _loader.load(_urlRequest, _lc);
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-06-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-09-10
      • 2012-12-02
      • 1970-01-01
      • 2013-02-02
      相关资源
      最近更新 更多