ok i have a navigation menu that loads external swf files into a blank movie, but i want a small preloader to lplay before loading the files. how would use ifFrameLoaded and gotoAndPlay to play my preloader in this blank frame while the swf loads?
ok, have two frames at the beginning of your external swf.
On the first frame put this ::
ifFrameLoaded (400) {
gotoAndPlay(10);
}
On the second frame put this ::
gotoAndPlay(1);
First line of code “400” that is the number of frames flash checks that has been loaded so if you only have 300 frames , just put 300, then it tell it to go and play frame “10” which is where the beginning of your animation is.
Second line just teling it to repeat!!
Now for an animation, create a simple animation in a moviclip.
Drag it onto the main timeline, enter a keyframe above the first frame of the preloader, and place your animtion there, create another keyframe right after it (above the the second line of code) so you have your movieclip over two frames!!
Let me know how u go!!
=)
ifFramesLoaded is a bit outdated. I believe that is a Flash 4 (possibly also Flash 5) thing.
There are many preloader tutorials on kirupa.com that teach the better more accurate method of preloading.
which method is the best for preloading as far a speed and quality??
Well, technically both methods work, but I think ifFramesLoaded will probably (if not already) be deprecated (fazed out).
Anywho, the getBytesLoaded and getBytesTotal methods are the new improved way. It actually gets the file size of your file, and waits until the entire movie size is loaded before it plays, and not just waiting until a certain frame is loaded up to. IMO this is more accurate, but I never really compared the two.
Here are so preloader tutorials on this site you can follow.
Basic Preloader -
http://www.kirupa.com/developer/actionscript/preloader.asp
Preloader Component (touch this and die…well it is an opinion, but I highly dislike this method, and we get a lot of questions on the forum about it not working) -
http://www.kirupa.com/developer/mx/percentage_loader.asp
Percentage Preloader -
http://www.kirupa.com/developer/mx/preloader.asp
Percentage Preloader with Loading Bar -
http://www.kirupa.com/developer/mx/percentagepreloader.asp