9 Replies Latest reply on Nov 21, 2009 5:26 AM by Ned Murphy

    loadMovieNum

    erin027

      Hello Experts...
      I am using Actionscript 2.0 and I'm a newbie.
      anyway, I have four swf files:

      Main.swf
      Mac1.swf, Mac2.swf, Mac3.swf

      On Main.swf, I have three frames and each frames it has these action scripts
      Mac1.swf:
      stop();
      unloadMovieNum(1);
      loadMovieNum("mac1.swf", 1);

      Mac2.swf:
      stop();
      unloadMovieNum(1);
      loadMovieNum("mac2.swf", 1);

      Mac3.swf:
      stop();
      unloadMovieNum(1);
      loadMovieNum("mac3.swf", 1);

      What I need to do is when mac1.swf loaded on Main.swf and when it reaches end of the movie, I want to load mac2.swf on Main.swf. Is there anyway that I can have actionscript to tell mac1.swf to gotoAndStop(2) on Main.swf? so that it will load the mac2.swf?

      Thanks in advance

        • 1. Re: loadMovieNum
          Ned Murphy Adobe Community Professional & MVP

          One way, if you have the ability to edit the files being loaded, is to include a command at the end of the loaded movie:

           

          _parent.nextFrame();

          • 2. Re: loadMovieNum
            erin027 Level 1

            Thanks, but it didn't work.

            If I add _parent.nextFrame(); on Mac1.swf, it just loops itself.

             

            On the last frame of Mac1.swf, I need an actionscript to gotoAndStop(2) on Main.swf so that it will load the mac2.swf on Main.swf.

             

            Did I explain it well?

            • 3. Re: loadMovieNum
              kglad Adobe Community Professional & MVP

              ned gave code for the last frame of the loaded swf.   despite your feeling you should use something with gotoAndStop(2), using _parent.nextFrame() is better.

               

              the only thing it won't do, is return your main timeline to frame 1 when the last swf finishes.  for that you should use, _parent.gotoAndStop(1) on the last frame of the last swf (if you want to re-load the first swf).

               

              p.s.  you don't need to use unloadMovieNum(1) on any of your main timeline frames.

              • 4. Re: loadMovieNum
                erin027 Level 1

                Thanks

                It's funny.. end of the mac1.swf, it keeps playing mac1.swf over and over again.

                 

                when you said "_parent..", is it Main.swf or mac1.swf? it should be main.swf, correct?

                • 5. Re: loadMovieNum
                  Ned Murphy Adobe Community Professional & MVP

                  using _parent within the loaded movie's (mac1.swf) main timeline should target the main.swf file's timeline.  You might also try using _root, or even _level0.

                  1 person found this helpful
                  • 6. Re: loadMovieNum
                    kglad Adobe Community Professional & MVP

                    oops, you're loading into _level1.  you must use:

                     

                    _level0.nextFrame();  // in all loaded swfs except the last

                     

                    and

                     

                    _level0.gotoAndStop(1);  // in the last loaded swf.

                    • 7. Re: loadMovieNum
                      erin027 Level 1

                      Thank you!

                       

                      level0... worked, but _parent or _root didn't work.

                       

                      Thank you again!

                      • 8. Re: loadMovieNum
                        kglad Adobe Community Professional & MVP

                        that's correct.  only _level0 will work because you're loading into a non-zero level.

                         

                        that's so unusual for experienced flash users that ned and i both forgot that (momentarily).  i almost never use non-zero levels and i suspect ned doesn't often use them, either.

                        • 9. Re: loadMovieNum
                          Ned Murphy Adobe Community Professional & MVP

                          I think I last used loadMovieNum about 6 years ago, and except for needing it to solve someone else's posting recently, having to use anything of the _level# syntax has been non-existent for me.