2 Replies Latest reply on Sep 12, 2006 4:08 PM by Rothrock

    Loading External Clips / Problem

    michael novia Level 1
      Hello!
      Alrighty, on my main stage, i have a empy clip instanced as "container".
      My buttons, are loading external clips into the container, via

      _root.container.loadMovie("external/whatevermovie.swf");

      Now, all of the external files i am loading, have movieclips, that interact. Somewhat like mini-sites.

      One movie that is loaded for instance, is just a few buttons, and a movieclip containing diffrent text. The buttons that control what frame the text movie goes to, is somewhat like.

      _root.textarea.gotoAndPlay(10);

      Now, all works fine, until the movie is loaded into the main file container. I have tried the following to maintain the functionality:
      _root.container.textarea.gotoAndPlay(10);
      container.textarea.gotoAndPlay(10);
      _parent.textarea.gotoAndPlay(10);
      etc.

      Any help would be greatly appreciated!

      Thanks,
      Mike
        • 1. Re: Loading External Clips / Problem
          michael novia Level 1
          Oops, if i didnt make that clear- the loaded movies arent working correctly as far as the interactivity inside of them :)

          Thanks,
          • 2. Re: Loading External Clips / Problem
            Rothrock Level 5
            So obviously you have figured out that this is the infamous "_root ain't what it used to be when I'm loading external files so my paths aren't correct problem"?

            Personally I never use _root and prefer to always have my action use relative addressing using this and _parent. In that case if you get it working in the swf by itself you won't have to worry about it once loaded into another swf. I'm assuming that there isn't communication between the swfs – at least for this part of the problem?

            Unfortunately only the one correct path will work – so when I find myself flailing around I sometimes take a step back and look at where everything is. So when you are using the testing environment go Debut–>List Variables. That will show you where everything is – not necessarily where you think it is. You can also have the button tell you "where it is" by putting the following in the release handler:

            trace("Current scope is: "+this);

            Finally one more trick is that sometimes the function or method that I'm trying to invoke isn't actually correct or the arguments aren't correct – you know like you say go to frame 10, but there isn't a frame 10 and some such. So sometimes I try and do something I know will work. If I can get that working then I know the path is right and I need to work on something else. My favorite is:

            _parent.textarea._alpha=50;

            With that kind of trick to you can work the path out one step at a time.

            _parent._alpha=50;

            Does that make the _parent 50 percent?