Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

need a preload bar for dynamic images 1

Status
Not open for further replies.

iostream71

Programmer
Mar 13, 2002
229
US
i have an empty clip that i load dynamic images into. i was wanting to add a small preload bar to it. how can i do this in flash mx? thanks
 
You have to put the loading code into another clip in order to do this.

When you use a clip as a holder to load an image into as soon as you trigger the load the clip is emptied so you lose your code. But if the loading code is in another clip then you can use it to monitor the load's progress.

So if your picture holder clip is called 'picHolder' you could do this in another clip on the same timeline.

this.onEnterFrame=function(){
totalBytes=picHolder.getBytesTotal();
loadedBytes=picHolder.getBytesLoaded();
percent=Math.round(loadedBytes/totalBytes*100);
}

and use 'percent' to display the information however you want.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top