Normally my preloader is 20 frames and looks like this:
Frame 1 Actionscript:
var amountLoaded:Number = _root.getBytesLoaded()/_root.getBytesTotal();
preloader._width = amountLoaded * 200;
loadText.text = Math.round(amountLoaded * 100) + "%";
if(_root.getBytesLoaded() == _root.getBytesTotal()) {
gotoAndPlay(21);
}
else {
gotoAndPlay(1);
}
On Frame 20, we obviously have:
this.gotoAndPlay(1);
This works fine, but it is only the home page I want the intro of my flash to play. Therefore, I use FlashVars on every other page than the home page to tell the animation where it should skip to.
To do this, I have placed this on the first frame after the preloader:
gotoAndPlay(AdFrame);
and in every page except the home page, I have added this Flash Variable:
<param name="FlashVars" value="AdFrame=39" />
My question: How can I skip the preloader entirely if the animation is loaded?
My failed attempt: I have tried moving my preloader to start on frame 2, and on frame one, changed:
var amountLoaded:Number = _root.getBytesLoaded()/_root.getBytesTotal();
preloader._width = amountLoaded * 200;
loadText.text = Math.round(amountLoaded * 100) + "%";
if(_root.getBytesLoaded() == _root.getBytesTotal()) {
gotoAndPlay(AdFrame);
}
else {
gotoAndPlay(2);
}
But it still does not bypass the preloader.
Any idea on how I can skip the preloader entirely if the content is loaded?
enterFrame
in your script – mgraphgotoAndStop
where? On my failed attempt first IF statement? If so, that doesn't make sense because the condition is going to the "else" on my failed attempt. 2) Addstop();
to the last keyframe of the entire animation or to the last keyframe of the preloader? Neither would make sense. – WebMWpreloader._width = amountLoaded * 200; loadText.text = Math.round(amountLoaded * 100) + "%";
doesn't correctly constitute loaded (cached) content. I don't know what else I can use, but it would be great to add in a line about "IF CACHED" go HERE! (Ya know?) – WebMW