You could try using the PreloadAssetManager class at
http://www.greensock.com/ActionScript/PreloadAssetManager 

Jack


-----Original Message-----
Date: Wed, 13 Jun 2007 16:17:42 +0100
From: "Poole, Simon" <[EMAIL PROTECTED]>
Subject: [Flashcoders] re: preloading images from xml
To: <[email protected]>
Message-ID: <[EMAIL PROTECTED]>
Content-Type: text/plain;       charset="ISO-8859-1"

Hi

Im having an issue with the following code. It is tracing the individual
thumbnail images correctly with the onLoadProgess function, but will only
display the percent loaded and loadbar for the last image (image 10), once
this one has preloaded, all the other images then appear correctly.

I would like it to preload all 10 images, displaying the percent and loadbar
for all 10.

The thumbnails images are buttons for a flv video player.

Ive been trying to fix this for ages and can sort it, its doing my head in!

Any help would be greatly appreciated.

Ty

s

/////////

    var newClip:MovieClip =
vidbutn.holder_mc.createEmptyMovieClip("thumbie"+(i+1),
this.getNextHighestDepth());
    var myLoader:MovieClipLoader = new MovieClipLoader();
    var myListener:Object = new Object();
    
    myListener.onLoadProgress = function (target:MovieClip,
bytesLoaded:Number, bytesTotal:Number):Void {
        trace(target + ".onLoadProgress with " + bytesLoaded + " bytes of "
+ bytesTotal);
        vidbutn.holder_mc.infoField =
Math.floor(bytesLoaded/bytesTotal*100)+"%";
        if (bytesLoaded != bytesTotal) {
                vidbutn.holder_mc.loadBar._yscale =
Math.floor(bytesLoaded/bytesTotal*100);
                /*return;*/
                }
        if(bytesLoaded == bytesTotal) {
                vidbutn.holder_mc.gotoAndPlay(2);
        }
    }
    myListener.onLoadInit = function (target:MovieClip):Void {
        //trace (target + ".onLoadInit");
    }
    myLoader.addListener(myListener);
    myLoader.loadClip(myRoot+thumbPath+thumbList[i], newClip);

/////////




_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to