3 Replies Latest reply on Feb 17, 2010 1:05 PM by Rothrock

    tracing the level of a loaded .swf

    Limon26 Level 1

      I'm using a loadMovie script to load in my .swf files.

       

      How can I trace the level of a loaded .swf?

       

      Also, here are my load scripts:

       

      loadMovie("movie1.swf", 1)

      loadMovie("movie2.swf", 2)

       

      I thought level 2 would be behind level 1, but movie2.swf is showing up overtop of movie1.swf?

        • 1. Re: tracing the level of a loaded .swf
          Ned Murphy Adobe Community Professional & MVP

          Levels ascend, so 2 will be above 1.

          1 person found this helpful
          • 2. Re: tracing the level of a loaded .swf
            Limon26 Level 1

            Ok great!  How do you trace the level of a loaded .swf?

            • 3. Re: tracing the level of a loaded .swf
              Rothrock Level 5

              If you are loading into levels you should use loadMovieNum or you should look into using the MovieClipLoader class—which is waaaayyy better than loadMovie/loadMovieNum!

               

              However levels are difficult to work with since there isn't really a class that represents them and so the number of methods, events, and properties are a little limited and not really documented.

               

              In fact is AS3 levels completely go away, so it really isn't the best thing to use.

               

              However. If you put code on a timeline:

               

              trace("Hello from movie1.swf I'm at: "+this);

               

              The trace will show which _level the clip is on.

               

              Also a little known trick is to do something like:

               

              _level1.swapDepths(_level2)

               

              which will swap the stacking order of the levels. Of course you have to wait until the content is loaded into the level because it doesn't exist before that. And they won't be renamed so it can get very confusing if higher number usually means higher in the stacking order...