3 Replies Latest reply on Jul 25, 2006 2:13 PM by SlashRipShred

    MovieClipLoader & lockroot

    SlashRipShred
      I've come across a rather strange problem with the MovieClipLoader - I have an actionscript file, which simply creates an empty movie clip on the root and loads a movie into it. The root of the movie clip is locked before the swf is loaded.

      class loader {
      public function loader(n:Number) {
      var loader_clip = _root.createEmptyMovieClip("test_" + n, n);
      loader_clip._lockroot = true;
      var loaderListener = new Object();
      var loadertest = new MovieClipLoader();
      loadertest.loadClip("Circle.swf", loader_clip);
      }
      }

      All i have for code in my .fla is this :
      var one = new loader(1);
      var two = new loader(2);

      and all I have for code in my loaded Circle.swf is
      trace(_root);

      Unfortunately, for some reason MovieClipLoader assigns the same root to both clips! For example, when I run my .fla, i get this as a trace:

      _level0.test_2
      _level0.test_2

      when i SHOULD get

      _level0.test_1
      _level0.test_2

      I have absolutely no idea why moviecliploader would act this way...i need to load the same movie multiple times and it has dynamic content, so I need _lockroot to work...any ideas?
        • 1. Re: MovieClipLoader & lockroot
          SlashRipShred Level 1
          Another interesting thing i've noticed:

          I took out trace(_root) in my circle.swf file, and instead placed the following:
          trace(_root);
          trace(this._parent);
          trace(this._parent._parent);
          trace("************");

          when I run the code, i get the following:

          _level0.test_2
          _level0.test_2
          _level0
          ************
          _level0.test_2
          _level0.test_1
          _level0
          ************

          so both loaded movie clips know that their parent's parent is the root of my main movie clip, and that their parent's are the respective movieclips that I loaded them in to. However - they both think, when I use lockroot, that their roots are the same - they both think their root is the root of the second loaded clip!!! If i DONT use lockroot, they both think their root is the root of my main movieclip (and then all my dynamically added content doesnt load)... Anyone have any idea as to what is going on??
          • 2. Re: MovieClipLoader & lockroot
            SlashRipShred Level 1
            Another interesting thing i've noticed:

            I took out trace(_root) in my circle.swf file, and instead placed the following:
            trace(_root);
            trace(this._parent);
            trace(this._parent._parent);
            trace("************");

            when I run the code, i get the following:

            _level0.test_2
            _level0.test_2
            _level0
            ************
            _level0.test_2
            _level0.test_1
            _level0
            ************

            so both loaded movie clips know that their parent's parent is the root of my main movie clip, and that their parent's are the respective movieclips that I loaded them in to. However - they both think, when I use lockroot, that their roots are the same - they both think their root is the root of the second loaded clip!!! If i DONT use lockroot, they both think their root is the root of my main movieclip (and then all my dynamically added content doesnt load)... Anyone have any idea as to what is going on??
            • 3. Re: MovieClipLoader & lockroot
              SlashRipShred Level 1
              Another interesting thing i've noticed:

              I took out trace(_root) in my circle.swf file, and instead placed the following:
              trace(_root);
              trace(this._parent);
              trace(this._parent._parent);
              trace("************");

              when I run the code, i get the following:

              _level0.test_2
              _level0.test_2
              _level0
              ************
              _level0.test_2
              _level0.test_1
              _level0
              ************

              so both loaded movie clips know that their parent's parent is the root of my main movie clip, and that their parent's are the respective movieclips that I loaded them in to. However - they both think, when I use lockroot, that their roots are the same - they both think their root is the root of the second loaded clip!!! If i DONT use lockroot, they both think their root is the root of my main movieclip (and then all my dynamically added content doesnt load)... Anyone have any idea as to what is going on??