4 Replies Latest reply on Sep 6, 2009 1:11 AM by flash00708787

    load external movie

    flash00708787

      i am totally new to flash, i have two swf and i want to load one into another, 1.swf and 2.swf, in 1.swf on first frame i loaded the movie using this code

       

      loadMovieNum ("2.swf", 1);    

       

      and in 2.swf on last frame i put this code

       

      stop();

       

      but when i run both are running

       

      what i want is that in 1.swf on startup 2.swf should load and when it finishes then 1.swf should start [while 2.swf should be no more visible on screen]

       

      how can i achieve this?

        • 1. Re: load external movie
          Lon Winters Level 4

          Before I get chastised for not providing the absolute right solution, this is how I usually handle it and I do thing it's the best method.

           

          First, I don't use loadMovieNum anymore - I found it too bothersome to keep track of all those levels.  Instead I load external SWF's into an emply movie clip.

           

          1. Create another movie which will load the other two, such as main.swf.

          2. On the first (and only in this case) frame, create an emply movie clip.  Same dimensions and frame rate as the other two, place it at 0,0 and give it and instance name, such as mcLoader.

          3. Frame action: loadMovie("1.swf", "mcloader");

          4. On the last frame of 1.swf put: loadMovie("2.swf", "loader");   This will automatiically unload 1.swf.

          5. On the last frame of 2.swf put a stop action, or you could even load 1.swf again if you want.

          • 2. Re: load external movie
            flash00708787 Level 1

            thnaks Winters for the reply,

             

            i did exatly what you said but nothing is happening in main.swf its blank.

             

            actually i main 1.swf is loading but then 2.swf is not loading 

             

            note: i am using CS4 -> AS 2.0

            • 3. Re: load external movie
              flash00708787 Level 1

              what is loader here [if i am not wrong u r putting one more empty movie clip on 1.swf and this is instance name, correct me if i am wrong]?

              • 4. Re: load external movie
                Lon Winters Level 4

                Just to clarify, you should have 3 SWF's total, I can't tell from your post if you did that.  main.swf, 1.swf and 2.swf.

                 

                The only thing in main.swf is the emply movie clip for a loader, and the action to load 1.swf.  There is no need for another emply movie clip anywhere else as both the other movies will load into that one in main.swf.