13 Replies Latest reply on Aug 19, 2009 1:34 PM by kglad

    Nested movie clip not playing

    TC5 Level 1

      I have a movie clip (that includes a preloader and video elerments) that I created and made a .swf file from which I then imported in my main movie. I then place this .swf file (which is listed as a movie clip symbol in the library) onto the main timeline. I put an action to stop the main timeline at the frame where the nested movie is placed and expected to start. When previewing the movie, the nested movie doesn't play. I see the preloader (in scene 1 of the nested movie)  appears for a second but the movie doesn't play.

       

      Any specific action command needs to be define to make the nested movie play?

       

      Thanks for any help.

        • 1. Re: Nested movie clip not playing
          kglad Adobe Community Professional & MVP

          when you import a swf all actionscript is lost.

           

          to remedy, load your swf.

          • 2. Re: Nested movie clip not playing
            TC5 Level 1

            Thanks for your reply.

             

            When loading external movies how do I position them where I want on the stage?

             

            Any good tutorials out there on loading external movies and the ins and outs of target paths and any related scripts etc.? Some ready made script and instructions would be helpful as the coding for this function seems pretty specific.

             

            Thanks.

            • 3. Re: Nested movie clip not playing
              anncalli

              lynda.com has some flash tutorials, but the Adobe help area is good too.

              1 person found this helpful
              • 4. Re: Nested movie clip not playing
                TC5 Level 1

                Thanks. I found a few tutorials that seem good. I'll have a look at Lynda.com

                 

                It seems when loading a movie it gets positioned automatically at the top left corner of the stage? Any way to assign another specific position for a loaded movie?

                • 5. Re: Nested movie clip not playing
                  anncalli Level 1

                  I am not an advanced flash user yet, but I suggest to click on component on the stage, then click on properties menu and click on the X and Y figures...then type in your desired location for the component.

                  • 6. Re: Nested movie clip not playing
                    kglad Adobe Community Professional & MVP

                    assign your loader (as3) or target movieclip (as2) to the position you want.  that's where your loaded swf will be displayed.

                    • 7. Re: Nested movie clip not playing
                      TC5 Level 1

                      Thanks. I got the movie to load as it shows and plays in the preview exported swf but I cannot find it in my Flash movie. I don't know if it's on a layer or anywhere where I can select it.

                      • 8. Re: Nested movie clip not playing
                        TC5 Level 1

                        kglad, is that done in action script? What would be the exact syntax for x y position?

                         

                        Im in MX 2004 Pro.

                         

                        The code I got so far:

                         

                         

                        stop();
                        loadMovieNum("video1.swf", 1);
                        • 9. Re: Nested movie clip not playing
                          kglad Adobe Community Professional & MVP

                          loading into a _level is more difficult to control placement of the loaded object because you'll have to wait until loadiing is complete (use preloader code) and then assign:

                           

                          _level1._x=whatever;

                          _level1._y=whateverelse;

                           

                          if you load into a target movieclip, you need not use preloader code:

                           

                          this.createEmptyMovieClip("targetMC",1);

                          targetMC.loadMovie("video1.swf");

                          targetMC._x=whatever;

                          targetMC._y=whateverelse;

                          1 person found this helpful
                          • 10. Re: Nested movie clip not playing
                            TC5 Level 1

                            Thanks kglad this works well.

                             

                            Now if I wanted a loaded movie (within a target movie clip) to preload along with the main movie what would be the preload code and syntax needed?

                             

                            Also if I want to use a target Movie clip severat times I imagine the code:

                             

                            this.createEmptyMovieClip("targetMC",1);

                             

                            should only be used the first time the targetMC is used? What would be the code when wanting to use the targetMC a second time?

                             

                            Thanks very much for your help.

                            • 11. Re: Nested movie clip not playing
                              kglad Adobe Community Professional & MVP

                              you're loading the main swf into a preloader swf.  there should be no need to preload the preloader.

                               

                              to preloader the loading swf you can use:

                               

                              clearInterval(preloadI);

                              preloadI=setInterval(preloadF,100,targetMC);

                              function preloadF(mc:MovieClip){

                              var bl:Number=mc.getBytesLoaded();

                              var bt:Number=mc.getBytesTotal();

                              var percentLoaded=Math.round(100*bl/bt);   // use this to display preload progress

                              if(bl>0&&bl>=bt){

                              // preloading is complete.  proceed.

                              clearInterval(preloadI);

                              targetMC.play();

                              }

                              }

                               

                              if you want to load another swf AND keep the previously loaded swf, you should create another target movieclip:

                               

                              this.createEmptyMovieClip("anothertargetMC",2);  // use another name and depth

                              anothertargetMC.loadMovie("anotherswf.swf");

                              clearInterval(preloadI);

                              preloadI=setInterval(preloadF,100,anothertargetMC);

                               

                              if you want to remove the previously loaded swf, you can use:

                               

                              targetMC.loadMovie("anotherswf.swf");

                              clearInterval(preloadI);

                              preloadI=setInterval(preloadF,100,targetMC);

                              • 12. Re: Nested movie clip not playing
                                TC5 Level 1

                                Thanks kglad.

                                 

                                I'm not sure if I explained what I wanted to do correctly.

                                 

                                What I want to do is make sure a movie that will be loaded in a target movie clip in the main timeline will be loaded and ready to play when the main timeline starts playing and reaches the frame where that loaded movie is. There is a preloader to load the main movie and I would like the secondary loaded movie to preload at the same time as the main movie (as part of the main movie preloader). I guess I'm looking for the code to place in the first frame of my main movie's preloader section (first two frames of the main timeline is the preloader of my main movie).

                                 

                                 

                                 

                                I would like the secondary movie loading to be included in the main preload. Can this be done?
                                Thanks for your help!

                                 

                                The preloader code for my main movie:

                                 

                                Frame 1:

                                 

                                // percentCompleted is a Var in Dynamic Text.
                                percentCompleted = int((getBytesLoaded()/getBytesTotal())*100);
                                if (percentCompleted == 100) {
                                // bar is an identifier of the proccess indicator.
                                bar.gotoAndStop(percentCompleted);
                                gotoAndPlay("in");
                                }
                                Frame 2:
                                _root.gotoAndPlay (1);
                                • 13. Re: Nested movie clip not playing
                                  kglad Adobe Community Professional & MVP

                                  remove the preloader from the main timeline.  in your preloader, preload the main swf and and whatever will be loaded by the main swf.