?
Solved

Buttons in loaded movie don't work.

Posted on 2003-02-19
4
Medium Priority
?
193 Views
Last Modified: 2012-05-04
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
0
Comment
Question by:Chocko
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 6

Expert Comment

by:henryww
ID: 7985621
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) {
   _root.animation.gotoAndPlay(28);
}



// 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) {
   _root.animation.gotoAndPlay(28);
}


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

cheers
0
 
LVL 5

Expert Comment

by:elhy
ID: 7985959
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. :)

0
 

Accepted Solution

by:
gromitboy earned 200 total points
ID: 7986277
Hi

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.

Stu
0
 

Author Comment

by:Chocko
ID: 7987257
Thank you very much, couldn't have been clearer.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I know the transition can be hard. We got used to the ease of use ActionScript 2 had, but honestly, it became problematic later on, especially if designers were involved in the project and found it easy to add code as they saw fit. So, this artic…
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…
The goal of the tutorial is to teach the user how to set there setting in Adobe Flash Media Live Encoder and YouTube for optimal video and audio quality.
The goal of the tutorial is to teach the user how to use the auto adjust feature and what the different options do. When your video is not working right you can choose the auto adjust feature to help choose your settings.
Suggested Courses

762 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