5 Replies Latest reply on Nov 30, 2006 6:37 PM by kglad

    accessing documents loaded with loadMovie()

    robdawg777
      I must be missing something, but I can't seem to figure out how to access timelines or pretty much anything from a container swf in the swf's I'm bringing in with loadMovie()

      for example I have loadMovie("news_sign.swf", news_holder);

      I have tried several things but I (like just doing a simple stop on the clip) but I'm not getting it to work. What do I need to do?
        • 1. Re: accessing documents loaded with loadMovie()
          kglad Adobe Community Professional & MVP
          the _root timeline in new_sign.swf is news_holder when referenced from the timeline that contains your loadMovie() statement.

          so, if you have a movieclip in new_sign.swf that has path _root.mc1.mc2, after loading if you want to reference from your loadMovie() statement timeline, use
          news_holder.mc1.mc2.
          • 2. Re: accessing documents loaded with loadMovie()
            robdawg777 Level 1
            Awesome, thanks, I got somewhere. My other question is if I have a button in an external swf that I bring in using loadMovie() is there a way to have a button target an action in the main document, for example if I have a button in news_sign.swf that has named go_btn, can I have go_btn disable a button on the main document?

            I tried something like :

            news_holder.go_btn.onRelease = function(){
            bio_playbill_btn.enabled = false;
            }

            but that doesn't seem to work, I don't even know if it's possible
            • 3. Re: accessing documents loaded with loadMovie()
              kglad Adobe Community Professional & MVP
              oh yes, it is possible. everything in any flash document is accessible from anywhere within any flash document as long as both documents are opened on the same computer.

              in your case, you have the simplest situation where both documents are the same.

              again, the _root timeline in news_sign.swf corresponds to the timeline of news_holder. so, if news_holder is in mc1 and you want to reference something in mc1.about_holder, a button on the _root timeline of news_sign.swf could use

              this._parent.about_holder;

              this refers to the news_holder timeline (after loading), and _parent takes you to the parent of news_holder (which is mc1) and from mc1 you go to one of its child movieclips, about_holder.

              you can also use absolute paths which, i think, are easier to understand.

              so, if mc1 is on the _level0 timeline, you can use _level0.mc1.about_holder from anywhere in your _level0 movie, including news_sign.swf (after its loaded).
              • 4. Re: accessing documents loaded with loadMovie()
                robdawg777 Level 1
                Thanks all for your direction, I was on the right path, but I was pulling out my hair because I was a little off and I thought it should work, but I couldn't see where I was off.

                Thanks much
                • 5. Re: accessing documents loaded with loadMovie()
                  kglad Adobe Community Professional & MVP
                  you're welcome.