all groups > flash (macromedia) > august 2007 >
You're in the

flash (macromedia)

group:

Preloader on Multi-Pictures


Preloader on Multi-Pictures mattypee
8/8/2007 8:39:55 PM
flash (macromedia):
How can I have the preloader load all the pictures and then open the main
scene...

Right now I have this code put in to the "Preloader" layer on scene 1.

onClipEvent (load) {
total = _root.getBytesTotal();
} onClipEvent (enterFrame) {
loaded = _root.getBytesLoaded();
percent = int(loaded/total*100);
percen1 = ""+percent+"%";
gotoAndStop(percent);
if (loaded == total) {
_root.gotoAndPlay(10);
}
}

Right now when I test the movie the preloader works but when It is downloading
the first of 12 pictures it starts runnning. I would like it to download the
all of the pictres and then "gotoAndPlay(10).

Thanks in advance,
Mattypee
Re: Preloader on Multi-Pictures mattypee
8/9/2007 3:05:21 PM
Anybody have any idaes?????

Re: Preloader on Multi-Pictures Christian_Scholz-Flöter
8/9/2007 5:16:23 PM
[quoted text, click to view]

Since you so politely ask -- no, wait, "politely" would have meant a few
questionmarks less --, I might use variables to check whether all images
have been loaded.

Rough sketch:

Use LoaderClass;
onLoad (when Bitmap has been loaded completely), do not display it yet,
but rather increment a counter variable by one;
if-statement checks if (counter == 12) and makes Flash jump out of the
loading script, maybe starting a function that deals with displaying
picture 1 of 12 or something.


--
AddThis Social Bookmark Button