You want to use frame labels instead of scene names. It is actually an easier check point for Flash.
Here is one of the easiest, but most eye catching loaders to make:
First make your MCs.
1) Make an MC that has the text "Loading"
2) Make an MC that has the text "PLAY" (or done, or go, etc..)
3) Make a progress bar. This should be a plain nice bar with a color or fill gradient motion tweened from "empty" to "full" (masks work nice here too)
4)Put all these on your stage in 3 sequential frames. the loading text, bar and tweens on frame one and frame 2, play text on frame 3. Obviously, here we want to give the bar an instance name of "bar"
5) label frame 3 as "loaded"
6) in your actions layer on frame 2 put this:
7) in your actions layer on frame 1 put this:
Code:
PercentLoaded = _root.getBytesLoaded()/_root.getBytesTotal()*100;
if (PercentLoaded != 100) {
bar._xscale = PercentLoaded;
} else {
gotoAndStop("loaded");
}
Then in your Play MC's actions you can put
Code:
on(release){
gotoAndPlay("10");
}
For an even simpler method:
2 frames. In the first make a dynamic text box with the var label "myOutput"
then in the actions layer put this:
Code:
var percent = Math.floor(getBytesLoaded()/getBytesTotal()*100);
var myOutput = _root.percent +"% is now Loaded";
In the 2nd frame make sure the dynamic text box is in the same spot as in the first, and put this in the actions layer:
Code:
if(percent == 100){
gotoAndPlay(10);
}
else{
gotoAndPlay (1);
}
This will make a text percentile ( 1% counting up to 100%) in the text box and when it reaches 100% it will go to frame 10, or which ever you need.
Bookmarks