• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 200
  • Last Modified:

Buttons in loaded movie don't work.

I have a simple flash site consisting of the main SWF and three button that load external swf's into targets. The loaded movies contain buttons to navigate its own content. When I load the movies into the main swf, none of my buttons work. The button work when I export the movies independently. I have never experienced this problem. The swf's load but the buttons have no functionality. Can someone please help me solve this problem. Thank You
1 Solution
the object reference is different when the external movie is loaded into the another movie.

if a swf is intented to be used in another swf, avoid absolute path for object reference use relative reference like _parent, ../ etc

for exmaple:

//in the original movie - button.swf
// a button to goto a frame
// it works perfectly in a stand alone swf

// button ****
on (release) {

// main movie - load the above movie
loadMovie ("button.swf","btn",1);

//for the same  button ****
// not going to work, cos the object it is refering to
// it is now - _root.btn.animation <- !!!
on (release) {

that's could be the most obvious reason why your buttons are not working. so instead of absolute ("_root.etc") try in "_parent.etc" or "_parent._parent.etc", then it should work

You can oso use _level if you are loading that swf into a new level. actually _root should have work if you are loading your movie to a empty mc that is on the maintimeline.

maybe u should post the codes in your button so that we can debug for you, instead of giving suggestions that may or may not help u. :)


I had this problem a couple of months ago and I can tell you 100% for sure that the problem lies with your use of "_root"....

The buttons that you have in the loaded movie work when you run it seperately because they are referencing that particular movie's root level.

However when you load it into another movie (using loadmovie() or whatever), if you have used "_root" it will try and find whatever its looking for on the root of the main movie.

The simple way to get around this is to use relative paths rather than absolute paths.  To do this, click on the button thats giving you grief and open the actionscript panel. Make sure that you are in "normal" mode and not "expert" mode.  Click on the line that references what happens when the button is clicked.  You will see that the little "target" symbol lights up - click this and then click the "relative" radio button rather than the "absolute" button.

Hope that helps.  If you understand actionscript levels already, the simple answer to your problem is "stop using _root"!!  

Let us know if your problem goes away.  If you are still having problems with it, post the fla file and I'll have a look for you.

ChockoAuthor Commented:
Thank you very much, couldn't have been clearer.

Featured Post


Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now