Can someone plz help me with the following preloader which gives a percentage. I have only 2 weeks experience in flash and would greatly appreciate the help.
I have two scenes on my website 1)preloader 2)movie
I only want to preload up to frame 150 of scene 2 with the percentage showing 100% when all 150 are loaded. The code below loads my whole website all 600 frames.
your best bet, if you’re going to use framesLoaded and totalFrames, is to do a test. Check out the band width profiler to see how many bites load by frame 150, out of the total bites, then figure that into the equation. I’ll think about how exactly to go about that… but without looking at your file… it’s impossible for me to be sure.
i test movie and its 230000bytes.
Could you please help me change this equation to read 230000bytes rather than total bytes. I have tried to place it everywhere with no success.
This should be a “+” sign, not add. Flash 5.0 uses “+” for concate function. Try that out… not that I think it’s going to change your current problem, but it can’t hurt to have the correct syntax.
I’ll keep researching that percent problem.
Thanks for the compliment… sometimes I wonder about my mind.
actions for frame 2
if (_root.getBytesLoaded()<=230000) {
gotoAndPlay(1);
} else {
gotoAndPlay (“start”);
}
Then, in the first frame of scene two, open your Frame panel and give the flame a name of start.
I have never had any luck getting next and previous scene goto commands to work correctly. In addition to changing that command I’ve reversed the “if else” statement. This may not help that problem, but it’s good programing practice. Put the most common situational in the first place of an “if/else” statement. This way the processor doesn’t have to loop through the whole logic structure most of the time. It only goes on at all, if the conditional in the begining is not met.
Greg,
Try actionscripts and their tute on preloaders. I set mine up and it works really cool. It displays the total file size, bytes loaded, bytes left and a percentage all in little cool windows. And, well, it werked for me in a few hours and I am a flashhopper-I just folowed the instructions; here it is in case you wanna take a look. user.mc.net/~dschultz/ just throw in the httpthang in front and no www. I think its pretty cool and it made me feel I am getting somewhere.
pj
Creating engaging and entertaining content for designers and developers since 1998.