In this tutorial, I’m going to show you how your users can change movie backgrounds with multiple .fla files. I’m also going to show you how to load external .swf files in your movies.
Ok, for this tutorial we’re going to make 3 separate .flas. The first .fla Is going to be our “Loader” .fla. The loader .fla pulls together the other 2 .flas.
First, make a new movie. Right-click on the first frame of your new movie and go to Actions/Basic Actions/LoadMovie. This will add the LoadMovie action to your action panel. Now, click on LoadMovie (the one you just added to your Actions) if it isn’t highlighted. This will give you several options at the bottom of the movie.
URL- The URL of the Movie, or just movie.swf if you keep it in the same directory. We will be working from the same directory. Location- which you can choose Level or Target and the Level or Target variable. Variables- I’m just leaving it with Don’t Send.
Here are the values that we’re going to use for this movie:
Next Step:
Double-click LoadMovie Action again which is located under Basic Actions. Do this so that they are both in the same frame. This time we are going to use the following values:
Now Save this .fla as Loader.fla. We will be referring back to it for our testing stages.NOTE: Make sure that you save all your .fla files in the same directory.
Now we’re going to make our Background .fla.
Open a new movie. For this movie we are going to have 2 layers. Our action layer and our background layer.( I named mine accordingly)
In the first frame of your Actions Layer, right-click and go to Actions/Basic Actions/Stop. This will tell the movie to stop on this frame.
Now we are going to add a new frame to our Actions layer. Right-click on the second frame of our Actions Layer and select “Insert Blank Keyframe” Now repeat the Stop Action above with this layer.
Now on each frame of your Actions Layer, you should have an “a”
In the Background Layer we’re going to make our backgrounds.
For this example we’re only going to make 2 solid color backgrounds. You can add pictures, shapes, or anything else that you would like to customize your background.
In the first frame of your background layer, draw a box with the square tool that covers the entire area of your movie.
Then right-click your second frame of your Background layer and go down to “Insert Blank Keyframe”. In this frame draw a box just like you did in the first frame, except this time make it a different color. (This is important so that when we test the movie we’ll know if we did it correctly or not.)
Now save your .fla. For this tutorial I saved mine as Background.fla.
Now it’s time to make the buttons that tell our .flas to change from one background to the next.
Make yet another NEW movie.
From our past tutorials you should know how to make simple buttons. If you’re just tuning in, click here: www.FlashNewz.com/2001/0309.html and go to the paragraph in the first column titled, “How To Make Simple Buttons.”
Make 2 buttons in your first frame, layer one.
Make your first button say Background 1 and the second button say Background 2
Once you’ve made your buttons, right-click the first button and…
go to Actions. This will pop-up your Actions Menu.
Now under Actions ( Not Basic Actions ) double-click “TellTarget”
This will add
Under the TellTarget options you’re going to add “_level1” so it will look like:
This is going to tell our Menu.fla to communicate with our Background.fla which is on Level1 of our Loader.fla.
Now while your tellTarget is selected, double-click Goto action. Select the gotoandplay that was just added to your actions menu.
Below you will have several options.
The first thing we need to do is to uncheck the Go To and Play checkbox at the bottom of the pop-up. This will change your script from gotoAndPlay to gotoAndStop.
Make sure that “1” is chosen in the Frame option.
Your end result for this button should read
Now repeat this step on the second button, but where it says frame 1, make it say frame 2.
Save this movie as Menu.fla in the same folder as the other two.
Ok, it’s testing time!! Publish all your movies into SWF format in the SAME Folder.
Then open your loader SWF (or HTML) file.. and it should work properly!
Happy backgrounding!
Make sure to keep this tutorial along with the past tutorials. When I’ve finished this series, I’ll show you how to put them all together to make your ENTIRE Flash site using multiple .fla Files.
Let me know what you think of this tutorials!
Having created the outlines for FlashNewz and FLADownloads, John has become a strong voice in the Flash Community. His reviews and tutorials give great insight and knowledge to readers around the world. He has a keen eye for what’s hot and what’s not in the Flash world. He has also developed and continues to run his own flash portal as a side project to keep his mind on the Flash community
Being a key designer for advertising creative, he’s got style when it comes to grabbing readers attention. With a proven track record, there isn’t much this guy can’t handle.