I am somewhat experienced in movie-making (only movies, i know absolutely nothing about action-scripting). Can someone inform me how to make that loading bar in the beginning of the movie? Some of my cartoons are kinda big…speaking of which how come some files get so much bigger than others when they’re not even longer. Is there some trick to make the file size smaller? (Most of mine are hand-drawn on flash). Thanks again for your help guys.
It’s called a preloader… there are a couple of tutorials here at kirupa, this is a good one: Click here
Thanks, that was really helpful. I think I did something wrong though, but I don’t know what it is. The number % on the bottom works, but the bar doesn’t…it’s just a grey bar, with no animation showing how much is complete. I made it a movie clip with registration on the left, and the outline on a different layer and stuff…
http://ccc.domaindlx.com/Tofuthunder/Project%20Eden%20Flash.html
(actually a school projet I’m working on). That’s what it looks like right now. Thanks again!
You sure you gave the correct instance name to the loadBar?
Also, make sure that your loadBar is 100 pixels in width… if not, then change this part of the script to match the width of the loadBar: [AS]bytes_loaded = Math.round(this.getBytesLoaded());
bytes_total = Math.round(this.getBytesTotal());
getPercent = bytes_loaded/bytes_total;
this.loadBar._width = getPercent*100;
this.loadText = Math.round(getPercent*100)+"%";
if (bytes_loaded == bytes_total) {
this.gotoAndPlay(3);
}[/AS]
D’oh! I forgot to change the width to 100. Thanks again for your help, it finally works!
You’re welcome. :}
I am also trying to do this tutorial and mine is working as well, however, I don’t understand the part of adding the movie I want to load to the third frame.
Can I do this and have my movie within the same .fla, or how do I need to load an external movie? I did it with loadMovieNum and it did not work.
the gotoAndPlay(“3”) statement simply sends the playhead of the movie to the 3rd frame of the specified timeline. (in this case, _root) the only thing played then is what it on that frame, nothing is added unless scripted otherwise. if you put your animation beginning on frame 3 after the load has completed, the animation will play from there.
I went through this tutorial and I am wondering how to load an external movie
via loadMovie.
syntax:
_root.yourMC.loadMovie("movieName.swf")
where _root is the main timeline of the movie, yourMC is the clip’s instance name, and the statement in quotes is the name of the external flash movie you want to load.
so do i replace the:
this.gotoAndPlay(3):
with:
_root.yourMC.loadMovie(“movieName.swf”)
???
and on yourMC, is that the name of the loadBar movie clip??
Hi
I have been struggling with the same problem.
Used the tutorial you mentioned above, I get the bar to load (when doing ctrl+enter twice), but no text appears, I have the correct instance name for dynamic text (=loadText), no that is no biggie but my actual movie which is a movie clip in frame 3 does not “kick in” at all.
The bar just loads and afterwards the movie playhead just reaches frame 3 and… well nothing.
Here is my code:
actions layer frame 1:
bytes_loaded = Math.round(this.getBytesLoaded());
bytes_total = Math.round(this.getBytesTotal());
getPercent = bytes_loaded/bytes_total;
this.loadBar._width = getPercent100;
this.loadText = Math.round(getPercent100)+"%";
if (bytes_loaded == bytes_total) {
this.gotoAndPlay(3);
}
actions layer frame 2:
this.gotoAndPlay(1);
then I have a layer which contains my movie clip in frame 3 which without the preloader plays ok.The whole clip is contained in 1 frame which loops around and previously my whole flash was 1 frame long, (movie clip about 250 frames).
Any ideas.
Thnaks, Sami
well, i actually got mine to work. but i have my preloader loading an external file. I haven’t been able to test it on the web. It may help if you make your movie two seperate files.
Ok will try it thanks, is the logic as follows movie 1 preloader, movie 2 actual movie?2 separate flash movies?
Does movie 1 have to be same size as the actual movie (pixels)?
I noticed above the “trick” seems to be to replace the goto and play bit with _root.yourMC.loadMovie(“movieName.swf”)-Yes?
thanks for your help
sami
Thanks guys, I catually opted just to download the sample from the tutorial and attached my movie at the end, must finsih the site now, and will study thye intricacies later. Thanks for both of you in anycase
sami