This content has been marked as final. Show 6 replies
just use _root inside laoded swf file, it will refer the _root of your main movie after loaded swf file loaded.
I've tried this several times and it doesn't seem to be working... any other ideas?
it must work
lets say ur function inside main movie (in the main timeline)
trace("function from main "+str)
inside external swf anywhere : _root.test("it works!")
dont forget to load external swf into main :):)
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.
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.
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.