5 Replies Latest reply on Jul 26, 2006 10:27 AM by ddirk

    LoadVars in a loaded movie

    ddirk Level 1
      Im not totally sure how to explain this, so please bear with me...

      I have two movies, movie1 which loads movie2 onto level9. Movie2 has some actionscript and a dynamic text box that loads an external text file. Problem is:

      When i load movie2 by itself in the browser, it works just fine, the text shows up.
      When I use movie1 to load movie2, the text does not load.

      Any ideas what is causing this? code for Movie2 is below:

      myData = new LoadVars();
      myData.onLoad = function() {
      newstext_text.text=this.newsVar;
      };
      myData.load("newstext.txt");
        • 1. Re: LoadVars in a loaded movie
          micahkoga
          You must alter your text path relative to Movie1. Alternatively, you could do a Movie2._lockroot = true;

          Hope that helps.
          • 2. Re: LoadVars in a loaded movie
            ddirk Level 1
            well, im not sure I want to lock the root to the individual movies, I will still need control over movie 1...

            is there a change I could make to my LoadVars code?

            my structure is 'index.swf' loads 'root.swf' into level9. root.swf contains movieclip 'newsMov' which contains the dynamic text box, as well as the loadvars code.

            any suggestions? im not completely sure how to go about doing this.

            • 3. Re: LoadVars in a loaded movie
              OS_Design
              Try to use absolut address of clip where you want to load variables

              myData = new LoadVars();
              myData.onLoad = function() {
              //like this
              _level0.....before_movie.newstext_text.text=this.newsVar;
              };
              myData.load("newstext.txt");
              • 4. LoadVars in a loaded movie
                ddirk Level 1
                I think I have the concept, but I can't figure out how exactly to reference this variable.

                basically, the variable is '_root.newsMov.myData.newsVar'
                which works fine when i load the movie in firefox by itself. The problem comes when I load the movie via the index movie.
                If the new movie with the loadvars is loaded into level 9, how do I reference it?

                _level9.newsMov.myData.newsVar doesn't seem to work... any other ideas?

                Thanks to all who have helped so far
                • 5. Re: LoadVars in a loaded movie
                  ddirk Level 1
                  bumpty bump