flash - Movie clip loading display problem in ActionScript 2 - Stack Overflow

时间: 2025-01-06 admin 业界

I'm having a display problem with loading a movie clip after loading it, my display looks more like this, the first image is being loaded in a loader that looks corrupted and the second image is not being loaded in a loader that does not look corrupted

Here's how I load a movie clip, I do these 4 simple things:

this.container = _root.createEmptyMovieClip("_applicationLoader", _root.getNextHighestDepth());
        this.current = ApplicationController.APPLICATION_URL;
        this._loader = new MovieClipLoader();
        this._loader.addListener(this);
        this._loader.loadClip(this.current,this.container);

Here's the rest of my code of application controller:

static var PRELOADER_WIDTH = 230;
    static var PRELOADER_HEIGHT = 230;
    static var RETRY_ATTEMPTS = 0;
    static var MAXIMUM_RETRIES = 10;
    static var APPLICATION_URL = "http://<my ip>:<my port>/translator_wii";
    function ApplicationController()
    {
        platform.nintendo.wii.Wii.backgroundColor(0xFFFFFF);
        this._onLoadComplete = mx.utils.Delegate.create(this, this.onLoadComplete);
        this._onLoadError = mx.utils.Delegate.create(this, this.onLoadError);
        sugar.core.WiiSugarApplication.getInstance().initialize(this,"high",platform.nintendo.wii.core.WiiApplication.STAGE_ALIGN_TOP_CENTER);
        this.loadApplication();
    }
    static function main(pRoot)
    {
        if (ApplicationController.instance == null || ApplicationController == undefined)
        {
            ApplicationController.instance = new ApplicationController();
        }
        return ApplicationController.instance;
    }
    function loadApplication()
    {
        this.allowSecurityDomain();
        this.preloader = _root.attachMovie("logoIcon", "preloader", _root.getNextHighestDepth(), {_x:431.5, _y:225.25});
        this.preloader._width = ApplicationController.PRELOADER_WIDTH;
        this.preloader._height = ApplicationController.PRELOADER_HEIGHT;
        platform.nintendo.wii.WiiNetwork.setDefaultDomainMapping(1);
        platform.nintendo.wii.WiiNetwork.addCAMapping("<my ip>:<my port>",0);
        this.container = _root.createEmptyMovieClip("_applicationLoader", _root.getNextHighestDepth());
        this.current = ApplicationController.APPLICATION_URL;
        this._loader = new MovieClipLoader();
        this._loader.addListener(this);
        this._loader.loadClip(this.current,this.container);
    }
    function onLoadComplete(pTarget, pHTTPStatus)
    {
        _root.preloader.removeMovieClip();
    }
    function allowSecurityDomain()
    {
        System.security.allowDomain("<my ip>:<my port>");
        System.security.allowDomain("*");
        System.security.allowInsecureDomain("<my ip>:<my port>");
        System.security.allowInsecureDomain("*");
    }
    function onLoadError(pTarget, pErrorCode, pHTTPStatus)
    {
        if (ApplicationController.RETRY_ATTEMPTS <= ApplicationController.MAXIMUM_RETRIES)
        {
            ApplicationController.RETRY_ATTEMPTS += 5;
        }
        else
        {
            _root.preloader.removeMovieClip();
            Alarm.getInstance().build("serverError",pErrorCode);
        }
    }

The other movie clip is a .swf that pins a class to it's main timeline:

Translator.main(this);
stop();

Is there any fix to this, because my .swf file that is being loaded is 2,788 KBs and my loader .swf file is also 2,700 and something KBs. Some how, I got this to work, even in 2,000 KBs before.