0

シンプルなプリローダーを構築しようとしています。ステージ上に 4 つのムービークリップがあり、それぞれに xml ファイルから取得した画像を追加しています

theMap = new XML();
theMap.ignoreWhite = true;

theMap.onLoad = function(success){
    if (success) {
        theNodes = theMap.firstChild.childNodes;
        for (i=0;i < theNodes.length;i++) {
            theSrc      = theNodes[i].attributes.src; //the jpg
            theClip     = theNodes[i].attributes.clip; //the movieclip
            _root[theClip].loadMovie(theSrc); // adding the jpg to the movieclip
        }
    }
    else {
        trace('Cannot Load XML file.');
    }
}
theMap.load("map.xml");

すべて問題なく動作しますが、jpg は少し重いので、プリロードしたいと思います。それは可能ですか?

4

1 に答える 1

0
        var mcLoader:MovieClipLoader = new MovieClipLoader();
        mcLoader.addListener(this);
        this.onLoadProgress = function(target_mc:MovieClip,bytesLoaded:Number,bytesTotal:Number){
            var percentage:Number = int(bytesLoaded/bytesTotal*100);
            trace(percentage);
            if (percentage >= 100) { _root.waiting._visible = false; }
        }

        mcLoader.loadClip(theSrc,theClip);
于 2010-09-06T13:45:09.050 に答える