Well I am trying to create a preloader and it worked in theory but when I attempt to implement it is won’t work.
I think it has to do with my AS but am not sure
Here is th as:
function preLoader(loadIt) {
if (getBytesLoaded()>4 && getBytesLoaded() == getBytesTotal()) {
gotoAndPlay("start");
}
else {
pct = int(getBytesLoaded()/getBytesTotal()*100);
for(i=prevPct;i<pct;i++){
loadBar.pct.attachMovie("percentage", "p"+i, _root.loadBar.pct.getNextHighestDepth(), {_x:0, _y:0, percent:i});
prevPct = pct;
trace("Percent: " +pct+ " Previous: " +prevPct);
}
gotoAndPlay("load");
}
}
audio = new Sound();
audio.loadSound('sounds/OrdonTheme.mp3', false);
audio.volume =100;
audio.start();
_root.attachMovie('preLoader', 'loadBar', _root.getNextHighestDepth(), {_x:((550-200)/2), _y:((400-20)/2)});
preLoader(_root);
The preLoader(_root); is for something that I was attempting and didn’t turn out to work so I am going to come back to it.
The issue is that it moves on to the start frame before loading all (or any) of the percentages into loadBar (as it is supposed to) I am not sure what is wrong here but any help would be great.
If you want me to attach the whole file just ask.