-
Loader in parent or child!!!
Hello everyone,
I have a question and i need your help.
I made a movie with buttons that calls other movies with the LoadMovie
action. The question is were i should put the preloaders for those movies???
"If i was a king, i could do anithyng!"
-
Mom said "make me a Mod"
hi there
place them in the main movieclip that the others load in. this way it's there whenever needed and you won't add more KB to the loaded movies
hope that helped
-
Thank's but...
I understand but...now the problem is how will i make the preloaders?
I know how to make a loader for one movie (with a scene that preload the movie!) but where i should put the preloaders for all the other movies?
By making a scene with an action script that preload the all 4 movies or what?
"If i was a king, i could do anithyng!"
-
Senior Member
You could make a movie clip that contains the preloader for all the other movies, (give this the instance name preloader) in frame 1 of this movie clip leave a blank keyframe with just a stop(); action attached, this will hide the preloader until it is needed.
next in frame 2 of the clip add some actions,
Code:
if (_root[loaderClip].getBytesTotal() > 0 && _root[loaderClip].getBytesLoaded() > 0) {
var loaded = _root[loaderClip].getBytesLoaded();
var total = _root[loaderClip].getBytesTotal();
var percent = Math.round((loaded / total) * 100);
// using the percent variable you can make a loading bar or a message to tell the user how much is downloaded
if (loaded == total) {
_root[loaderClip].play(); // start the loaded movie
this.gotoAndStop(1); // hide the preloader again
}
}
in frame 3 you can loop back to frame 2 to keep running the preloader.
now to trigger this preloader when you want to load a movie you can use something like,
_root.myClip.loadMovie("filename.swf"); // load filename.swf into myClip
_root.preloader.loaderClip = "myClip"; // tell the preloader what clip the movie is being loaded into
_root.preloader.play(); // start the preloader
edit]oops I forgot, make sure you have a stop(); action in frame 1 of each movie you load, otherwise it will try to play straight away regardless of the preloader
-
;)
Thanx guy's...couldn't make it without your help
"If i was a king, i could do anithyng!"
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|