I can never seem to get preloaders working…
This is one attempt that im quite certain I want to work, but me and a friend can’t work out why the smeg it’s not working…
stop();
total = getBytesTotal();
done = getBytesLoaded();
percent = loader/total*100;
if (total == done) {
gotoAndPlay(3);
} else {
_root.load_square._width = percent*5.5;
/*whatever number is needed to times 100 to equal to stage width*/
_root.load_square._height = percent*4;
/*whatever number is needed to times 100 to equal to stage height*/
gotoAndPlay(1);
}
Thats the code on frame 1, frame 3 is some music (so i cant post the fla for copyright (and size) reasons).
There is a movieclip called load_square which is a 1pixel sqaure that is in the center of the stage, it’s meant to get bigger and will fill the stage up when its fully loaded.
When it’s run, the square doesnt grow, but when the movie is loaded it does go onto play the music.
I have tryed _yscale and _xscale as well, that doesnt work either, and my friend came up with this:
stop();
bytes_loaded = Math.round(this.getBytesLoaded());
bytes_total = Math.round(this.getBytesTotal());
getPercent = bytes_loaded/bytes_total;
this.load_sqaure._width = getPercent*550;
this.load_sqaure._height = getPercent*400;
if (bytes_loaded == bytes_total) {
this.gotoAndPlay(3);
}
Which does nothing at all…
Can anyone help me? I can’t see whats going wrong at all…