Loading external swf's

hey there. (novice)

i have followed the tutorial on the site but i have run into a few probs. i have created a stage which has my buttons and movie clip area for my clips to appear.

i have also created the movie clips individually. Yep you guessed it im having trouble as i dont know the script for the stage buttons onrelease to load up the externalswf into the main stage or even if i have done this correctly? if anyone is interested i can send them what i have done so you may be able to understand what mess ive created :slight_smile:

ta for any help


I’m trying to figure out what you’re saying your problem is. Are you saying that you went through the tutorial and the version you made doesn’t work, or are you saying you don’t understand how the tutorial is saying to put it together?

my movie clip works. what doesnt work is when i click on button to load the moviaclip. the initiation of the swf file. i dont know how to link my button to the external swf.

is that any clearer? :s

Ok the code for the button should be something like


where content is the instance name of the movie clip that you are loading the .swf files into. Be sure you have given an instance name to that empty clip. All of that should be in the tutorial though. Hope that helps.

hey again, thanks i got that ok but still its not working but i feel i know why. the container on main stage to hold the clips. the tutoral sys to make a movia clip and label in container and set the registration point. but im having trouble creting the blank movie clip?

basically ive got all the coding. all i need to learn is how to correctly build the container for the clips?


All you have to do is go to ‘insert’ up at the top on your toolbar, choose ‘new movie clip’, give it a name and make sure it’s being created as a movie clip and not a button or a graphic. Once it creates it, it’ll put you in the movie clip editor. Get out of that and get back onto the main timeline and drag the clip you just created from your library onto the stage and make sure it’s on its own layer. Click on the keyframe that you put it in so that you’re sure to select it, since it’s empty it can be hard to find. Click on it to select it and give it the instance name you want. Also, for its coordinates, put it at 0, 0. This should place it perfectly in the upper left corner. The .swf files that you load into this should have the same stage size as your main file. That’s all there is to it.

a ha! thank you very much :slight_smile:

I have no problem loading an external .swf into my movie. I have a problem with the way the movie that I just loaded plays.

For example: I made a movie “home.swf” that, when you replay it, the background is a random still image everytime. Also what happens is when you click a button in the movie “home.swf” a text window becomes hidden and unhidden.

Ok, so “home.swf” runs just fine. The background is a random image everytime and the button turns on and off the text window.

So, here is the problem…when I load this movie in another file called “Uni.fla” using an empty movie clip named “loadClipMenu” using this ActionScript:

loadClipMenu.loadMovie(“home.swf”, “0”);

When I do that the new movie “uni.swf” which is playing the file “home.swf” shows ALL of my random background images at the same time!!! Also because all the images are visible at the same time. It runs very slowly. Can you help me???

By the way here is the ActionScript I used to make “home.swf”:

// make sure none of the Bkg image Mc’s are visible initially.
_root.clip.blueMc._visible = false;
_root.clip.reliantMc._visible = false;
_root.clip.greenMc._visible = false;
_root.clip.planeMc._visible = false;
_root.clip.topMc._visible = false;
_root.clip.dockMc._visible = false;
// randomly select a Bkg image Mc to become visible.
choice = Math.round(Math.random()*5);
switch (choice) {
case 0 :
_root.clip.dockMc._visible = true;
case 1 :
_root.clip.reliantMc._visible = true;
case 2 :
_root.clip.blueMc._visible = true;
case 3 :
_root.clip.greenMc._visible = true;
case 4 :
_root.clip.planeMc._visible = true;
case 5 :
_root.clip.topMc._visible = true;

You’ve got your loaded .swf files referring to your root timeline. Get rid of your _root tags. Don’t use _root tags in your loaded .swf’s unless it’s something in your main file you want to effect. Without seeing all your stuff together i’m not sure how to tell you to make it exactly, but mess around with that and you should be able to get it to work.


Try just taking out your _root at the beginning of all your code in the loaded .swf.

without using _root, how can I have a (symbol) movie clip become visible or not visible?

Here is why I ask. I have Movie clips in my file “home.fla” and they each have an instance name…“topMc” and “blueMc”…etc…

I took off all of my “_root”'s from my actionscripts and they are all visible now when I hit Ctrl + Enter.

Could I get Flash to see my “topMc” and “blueMc”…etc…with out “_root.”

What happens when I take off the “_root” is this. the lettering turns from blue (recognized by ActionScript) to black (not recognized)

_root has to do with the path to what you’re referencing. If you’re inside a movie clip and you’re referencing something outside of it, use _parent. Like i said i don’t know how your pathing works without seeing it. The problem you’re having is that your _root references are looking at the root timeline of the .swf you’re loading everything into. _root always refers to the root timeline of your main .swf. You have to figure out the reference paths in your other files.

“_parent” worked. thanks. You’ve been a big help!