How to control or link external.swf movie from a button on the main movie.swf ?

Posted on 2010-09-14
Medium Priority
Last Modified: 2012-08-13
Hello my name is alan in the last few days

i was trying to find how I can control and link an ( external.swf ) movie

from a menu with buttons inside my main  movie call ( main.swf  )

I can not find the code to make work each button and call a frame label on a movie clip  ( pages mc ) inside my external.swf

Im using AS2

I have the structure of my movies like this.


Please download and check my fla. or see it here :



Question by:enixstudio
  • 2
  • 2
  • 2

Expert Comment

ID: 33679288
You have a movieclip called "container". Within this, you load a movieclip that IS NOW CALLED "container".

So, when you want to reference the external movie, you do it like this:

If you want to move to a frame, for example, assign this actionscript to a button on the menu:
on (release) {

Now when you click the menu button, the external clip will move to frame 2. Is this something like you wanted?

Author Comment

ID: 33679878
Hi bupper in response to your question is NO.

In my maine.swf movie I have a movieclip with the instance name call "container" this empty movieclip load inside my external.swf movie with the following code :

stop ();
this.createEmptyMovieClip("container", 1);

Now on my external.swf movie i have a movieclip with the instance name call "pages" inside this movieclip I have 5 frames labels called up "p1","p2","p3","p4","p5"

So my question its how i do to communicate from my button 01 btn ( inside menu mc > main.swf. ) to my external.swf movie to my > movieclip with the instance name call "pages" and goandplay the frame label call "p1" ?

Check this link example here :: Follow the red arrow !


if my menu was in the same movie lets say main.swf iknow this code works to call each frame label from my button 01 btn to > movieclip with instance name "pages" > to > my frame label call "p1" and works for each button !

on (press)
    if (_root.link != 1)
        _root.menu["item" + _root.link].gotoAndPlay("s2");
        _root.link = 1;
    } // end if

Check this link example here ::


In brief  I need to do this but with my menu in my main movie and my pages on my external movie.
and thanks for the help but I hope you can help me a bit more ! : )
LVL 39

Expert Comment

ID: 33680829
this is so odd, i'm sure I posted something on your topic this morning. oh well, maybe it was too early in the morning.

enixstudio what bupper is saying is correct.

not sure what your _root.link etc does, but the problem is here


as bupper says


Get 10% Off Your First Squarespace Website

Ready to showcase your work, publish content or promote your business online? With Squarespace’s award-winning templates and 24/7 customer service, getting started is simple. Head to Squarespace.com and use offer code ‘EXPERTS’ to get 10% off your first purchase.


Accepted Solution

bupper earned 1200 total points
ID: 33684060
First, when you load an external movieclip, and reference _root from within the external movieclip, it will refer to the _root of the entire thing (main.swf)! To get around this, put the following code directly after you load the external clip:
container._lockroot = true;

Now when you say _root in the external clip, it will refer to itself :)

For the menu buttons, on each menu button in the main movie, attach the following:

on (press)
    _root.container.container.pages.gotoAndStop("p2"); // OR p3, p4, p5, etc
LVL 39

Assisted Solution

blue-genie earned 800 total points
ID: 33686005
no bupper, your code is right, you dont'need the lockroot

i tested it.

Author Closing Comment

ID: 33686333
Thanks bupper and blue-genie for your attention and patience works to perfection and how you said you do not need the lockroot !

As a contribution i upload the files for people in need in the future:

Featured Post

Easily Design & Build Your Next Website

Squarespace’s all-in-one platform gives you everything you need to express yourself creatively online, whether it is with a domain, website, or online store. Get started with your free trial today, and when ready, take 10% off your first purchase with offer code 'EXPERTS'.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Recently, I was asked to recommend a tracking system to be implemented on a clients website. As the entire site was built on flash, my first thought was to suggest custom built tracking system. However, our company at that point of time didn't h…
In my long career of working as an actionscript developer, I had spent sleepless night often working hard to solve some small problems which actually took a lot of my development time; later found out the solutions to be a line or two. Here are s…
In this tutorial viewers will learn how to create a basic motion tween animation in Flash Open a new document in Flash: Draw/import an image: Press CTRL + F8 to convert it into a graphic symbol: Select a frame (how long you want the tween to last): …
The goal of the tutorial is to teach the user how to how to record live broadcast.

600 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question