Are you familiar with the Flash timeline?
By default, your SWF would have one frame. This frame contains your Preloader.as class.
At compile-time, FD creates a second frame, which contains your Main class -- the class you want to be run once the whole SWF has downloaded.
Preloader.as contains code that waits until all frames have been fully downloaded, and then instantiates the Main class.
More details from http://www.flashdevelop.org/community/viewtopic.php?f=9&t=5398:
When you create an "AS3 project with preloader", FD configures a few important things you should control:
in Preloader.as,
There is a call to resolve your main class:
getDefinitionByName("{qualified main class name}")
in Project properties,
Compiler options > Additional compiler arguments [...]
There should be:
-frame start {qualified main class name}
Flash knows to run Preloader.as first because FD puts it in the first frame, and FD does this because the Preloader class has been set to "Always Compile" (you can choose to set this option yourself by right-clicking a class and selecting "Always Compile").
You can do whatever you like in a preloader, but it won't run any of its code until everything needed by the preloader has downloaded. So if you make a preloader with a 3MB image file and a progress bar, the progress bar won't do anything until the entire image has downloaded!