Preloader ActionScript
 
Did you ever want to create a preloader for your flash movie where people can see how much from the file is downloaded? It works with the following code:
bytes_loaded = Math.round(this.getBytesLoaded());
bytes_total = Math.round(this.getBytesTotal());
getPercent = bytes_loaded/bytes_total;
this.loadBar._width = getPercent*100;
this.loadText = Math.round(getPercent*100)+"%";
if (bytes_loaded == bytes_total) {
this.gotoAndPlay(3);
}

What this script does is checking if the filesize fits the current loaded amount. If the file is loaded, this command will be executed: "this.gotoAndPlay(3);". Modify this one to fit your needs.

If you want to create a TextArea with the current loaded percentage: create a text area with the size you want, long enough to fit a maximum of 4 characters. With this text box selected, hit CTRL+F3 on your keyboard to open up the "Properties" panel and be sure the drop down box is set to "Dynamic" text and you give the text box the var name "loadText".

If you would like to create a statusbar of the current loaded amount, create a "movie clip" rectangle and name it "loadBar".

Check out this Link Link for more information.
 
admin / Dec 06, 2003
   
 
 
Login: 
Pass: 
 
 
     
     
2004 - 2019 / lookass.ch
makememad@lookass.ch