Troubleshooting a Flash Preloader.
Preloader Testing in Flash can be a headache sometimes, but there is a hidden feature built into the Flash Test Movie window that makes troubleshooting much easier! The Bandwidth Profiler.
1. Open your Flash movie and test your movie to bring up the test movie widow.
2. Open the “View” menu, find “Bandwidth Profiler” and enable it.
3. The Bandwidth Profiler will now be visible at the top of your test movie window.
Using the Bandwidth Profiler:
Once you have the Bandwidth Profiler enabled in your Flash Test Movie window, you have a lot more data at your disposal. First you should notice that it displays all of the properties of your SWF, including file size and load times. This is helpful information when you are trying to keep your file size down. As far as Flash preloaders go, the most helpful bitt of information here is the frame by frame graph. Most preloaders bounce back and forth between frames 1 and 2 until all of the bytes are loaded, then move on to frame 3 etc. As you test your preloader watch the frame by frame graph and make sure your actionscript is behaving properly. You can see instantly see if your movie is jumping to a frame it shouldn’t be.
Most Common Preloader Mistake:
The #1 question on every forum out there about troubleshooting a preloader is “Why can’t I see my preloader working until its almost (70-90%) done?”
The answer to this question is that it has little or no data (bytes) to “load.”
Tip: In a new layer, add 2 or 3 keyframes after your preloader, and place a hi-res image on each of those frames. This will give your flash preloader some work to do, so you can see it in action. Put a stop() action on the last frame. Note: Make sure there are no images on same frames as the preloader (typically the first two frames)
How to Simulate a Download!
Test your Flash movie and go to the “View” menu. Then go to the “Download Settings” and choose a speed. Hit Control (command-Mac) + Enter to start the test movie over, and your flash movie will pretend it is being downloaded at whatever speed you chose in the menu!
Using the Frame by Frame Graph
The key to a successful preloader is to keep the number of bytes on the first frame to a minimum. Your Flash preloader will not display any progress until all of the data on the first frame is loaded (that includes Actionscript) If you have uneccessary images or actionscript on the first frame, that aren’t needed until later in your movie, move the frames or make them empty.
Good ways to keep the size down on your First Frame:
1. Try not to use images.
2. Avoid key-framing your progress bar, use actionscript instead.
Example: movieClip_mc._width = percentloaded; (see below:)
3. Don’t import Illustrator shapes, draw in Flash.
4. Only embed the font characters you need (0123456789%, for most of you)
(While we’re at it) Basic Preloader Actionscript:
Frame 1
totalBytes = this.getBytesTotal();
loadedBytes = this.getBytesLoaded();
remainingBytes = totalBytes - loadedBytes
percentDone = int((loadedBytes/totalBytes)*100);
this.bar_mc._width = percentDone;
this.myText = Math.round(percentDone)+"%";
if (_framesloaded == _totalframes) {
gotoAndPlay(3);
}
Frame 2
gotoAndPlay(1);
Once you harness the power Flash’s Bandwidth Profiler, testing your Flash movies will never be the same!
Related Posts:






















Here’s an additional thought.
I’ve just spent the last two hours troubleshooting a preloader. My problem had to do with having actionscript linked symbols found in the library set to “export in the first frame”.
That is, in the library for symbols with linkages properties set, if the “Export in the first frame” is selected, the preloader won’t start until that symbols is loaded. In my case that was an audio file (the largest part of the movie).
Though it wasn’t key framed until frame 15 in the main timeline, it loads in the first frame until the “Export in the first frame” option is deselected .
Hope this helps some one else…
Hi Brent,
I’ve experienced the same problem. Unchecking the “Export in first Frame” option solved the preloader problem, but gave me a new problem.
I need certain movieclips to export in the first frame because they are being controlled by a main piece of actionscript in the timeline. So although the preloader now works, my movieclips are no longer able to be controlled by actionscript, even though they are still being “Exported for Actionscript”.
I’m using flash mx 2004…. If only there was a way to Export those moviecips in the second frame…..
Any thoughts or help with this would be great. Thanks!
Sorry Sarah, cannot help you but…
Brent:
Thanks - fixed my problem. I should point out the only one of my symbols that had that option checked was the embedded font - it must check “Export in First Frame” by default, when it is embedded.
Watch out for that one people.
OS
Sarah, I have the same problem as you.
I have MCs in my library that are called in via “attachMovie” and I need the “export to actionscript” (which also checks the “export to first frame” box). If I uncheck the “export to first frame” but keep the “export to actionscript” checked, it doesnt load the movie.
please let me know if you get this resolved and how. I will do the same, thanks~
Sarah, you must have gotten to the solution of the problem by now…but anyways…
After you uncheck “Export in First Frame”, if you have an instance of the same movieclip in timeline but offstage, the loader works fine. That way the code can be tricked into including those movieclips in the loader.
nice
If you go to publish settings -> Actionscript version, you’ll see a button named “Settings” next to the Actionscript version dropdown.
If you click that “Settings” button, you’ll see “Export frame for classes:”.
The default value for that one is 1, but if you use some standard components, they often use actionscript classes you dont need for your preloader.
And putting a big picture in it is just an EXAMPLE people, if you’ve got size problems in frame 1, that isn’t the solution. It’s just to test your preloader.
[…] traducción de bittbox) Flash | Permalink | 0 | […]
helped tremendously, thanks!!!
I ran into the same problem as Sarah, I’ve been searching for awhile now, it seems there’s no way to export in second frame? The only way now I can think of now is to use an external preloader (separate swf to load my main swf)..