Skip to main content
Known Participant
May 10, 2007
Question

External SWF controlling main timeline

  • May 10, 2007
  • 4 replies
  • 500 views
Hi all --

I have a main SWF file that I am loading a smaller, external SWF file into (with loadMovie, if you care to know). Within that smaller file, I have a button -- ideally, this button should trigger an action within the main SWF file.

My problem is that I cannot get the external SWF file to control an action within the main SWF. I'm guessing there must be a way to do this, but I'm having some trouble here.

Thanks in advance... please advise!
This topic has been closed for replies.

4 replies

Inspiring
May 10, 2007
That may be an issue. When in doubt, use an absolute URL to load an SWF until you find out what the problem was.

I can't recall if, when contained in an HTML page, a SWF uses it's own actual path or if it uses the HTML page's path.
Inspiring
May 10, 2007
Well.... there may be a reason if it is set up correctly and still doesn't work....

Is this external SWF hosted on another server?

If so, you might be running into crossdomain policy problems. I've had the issue that remotely-hosted SWFs will not OBEY commands from the root timeline while they are remote, but work just fine when they are copied onto the same server as the main SWF.

Do a search on crossdomain policy XML in Flash help. It may help you get around this problem.
Known Participant
May 10, 2007
I seem to have gotten it working now from some of the suggestions above. Not sure what was wrong before. Is it an issue if the SWF that I am loading is in a subfolder? It's on the same doman, just one level down in a subfolder from the main SWF.

Thanks again everyone, much appreciated.
Participating Frequently
May 10, 2007
it must work
lets say ur function inside main movie (in the main timeline)
function test(str){
trace("function from main "+str)
}
.................
inside external swf anywhere : _root.test("it works!")

dont forget to load external swf into main :):)
Participating Frequently
May 10, 2007
just use _root inside laoded swf file, it will refer the _root of your main movie after loaded swf file loaded.
Known Participant
May 10, 2007
I've tried this several times and it doesn't seem to be working... any other ideas?