Just made a basic preloader, using action script to move the playhead along the timeline of an mc until it reaches the end (last frame being 100% loaded). However: the playhead on the root timeline already skips to the next frame of the website before the complete preloader animation has run! When ca. 85-90 % is loaded, the playhead already continues to the rest, the preloader is never fully played. What can be done?
This is the script I used:
First frame on the root:
stop();
onEnterFrame = function(){
var percent_loaded = _root.getBytesLoaded()/_root.getBytesTotal();
preloader_mc.value = percent_loaded;
if (percent_loaded == 1){
delete onEnterFrame;
play();
}
}
On the preloader mc:
var value = 0;
onEnterFrame = function(){
var frame = 1 + Math.round((animation_mc._totalframes - 1) * value);
animation_mc.gotoAndStop(frame);
}
onEnterFrame();