ToshTrent
Technical User
- Jul 27, 2003
- 209
Hi,
I am trying to make a preloader which is another flash movie which can be called upon when ever needed, I seem to be having some problems making it work. I thought just add the level number before the getbytes and all would be good, but nope.
Here's the code i am using in the preloader;
KeyFrame1
[blue]if ((_root.getBytesLoaded() == _root.getBytesTotal())) {
gotoAndPlay("complete");
txtPercentage = "100%";
} else {
gotoAndPlay(2);
}[/blue]
KeyFrame2
[blue]//gets how many bytes have been downloaded to the computer
var LoadedBytes
LoadedBytes = (_level1.getBytesLoaded());
//gets how many bytes the file is in total
var FileSizeBytes
FileSizeBytes = (_level1.getBytesTotal());
//displays the progress in percent
txtPercentage.text = int((LoadedBytes / FileSizeBytes) * 100) add "%";
//updates the progress bar
tellTarget ("loader") {
gotoAndPlay(Math.round((_level1.getBytesLoaded()/_level1.getBytesTotal())*100));
}[/blue]
KeyFrame3
[blue]gotoAndPlay(2);[/blue]
The preload movie is loaded to level2, the movie to be loaded is on level1, is there something wrong with this code for it to work for another level?
Thanks for your help.
Tosh.
I am trying to make a preloader which is another flash movie which can be called upon when ever needed, I seem to be having some problems making it work. I thought just add the level number before the getbytes and all would be good, but nope.
Here's the code i am using in the preloader;
KeyFrame1
[blue]if ((_root.getBytesLoaded() == _root.getBytesTotal())) {
gotoAndPlay("complete");
txtPercentage = "100%";
} else {
gotoAndPlay(2);
}[/blue]
KeyFrame2
[blue]//gets how many bytes have been downloaded to the computer
var LoadedBytes
LoadedBytes = (_level1.getBytesLoaded());
//gets how many bytes the file is in total
var FileSizeBytes
FileSizeBytes = (_level1.getBytesTotal());
//displays the progress in percent
txtPercentage.text = int((LoadedBytes / FileSizeBytes) * 100) add "%";
//updates the progress bar
tellTarget ("loader") {
gotoAndPlay(Math.round((_level1.getBytesLoaded()/_level1.getBytesTotal())*100));
}[/blue]
KeyFrame3
[blue]gotoAndPlay(2);[/blue]
The preload movie is loaded to level2, the movie to be loaded is on level1, is there something wrong with this code for it to work for another level?
Thanks for your help.
Tosh.