This shows you a different kind of preloader for movies with components or other objects exported in frame 1 (linkage). At the same time you learn how to create a local connection to let two movies talk to each other. What this type of preloader, however, cannot do is count the loading. So we have to put something in to entertain the user or show the loading happening.


The principal idea is to create two movies, one which is the receiving movie and shows the loading and one which is the sending movie and will send a variable to indicate loading is finished.

The final product


Setting up the movies

Parent movie

We create 2 movies: our parent movie and the lodd-indicating movie. Our parent movie will be the sender and we want to know when it is loaded. So the actionscript in the sending movie will be something like this.
//we first create a local connection object
var sender:LocalConnection = new LocalConnection(); //then we make a boolean var and define it to true.
var loaded:Boolean = true; //now we make the sender function, which will be recived by the other movie.
//the arguments are for the listener, the functionname and the boolean var.
sender.send("parentConnection", "doAction", loaded);

Receiving movie

Now we turn to the receiving movie. We create a movie with 2 frames and stop() in each frame. In the first frame we put our entertaining animation and in the second frame we put a welcome message for example as I did here. This will be the script in the first frame.
stop();
//we first create a local connection object
var receiver:LocalConnection = new LocalConnection(); //we now have to constantly monitor a signal from the sending movie.
_root.onEnterFrame = function() { receiver.doAction = function(loaded:Boolean) { //once the signal is received the function is executed.
delete _root.onEnterFrame; //loaded will now be defined...
if (loaded) { //the timeline will go to next frame.
_root.gotoAndPlay(2); } }; receiver.connect("parentConnection"); };

And this is basically all we need to do. We can reuse the receiving movie and the scripts allover again.