10 Replies Latest reply on Jun 17, 2011 1:58 PM by kglad

    Attach movie

    juresti Level 1

      ToolShopAnim01.swf is loaded goes to frame with this code:

       

       

      _parent.attachMovie("buttonblanklevel", "butt_levelone", 3, {_x: 217, _y: 5});   
          _parent.butt_levelone._alpha = 50;
         
      _parent.butt_levelone.onRelease = function() {
         
          _parent.gotoAndStop("BacktoShop");
      }

       

      In frame "BacktoShop" on parent:

       

      movieHolder.loadMovie("ToolShopAnim01.swf", "ToolShop");

       

      butt_levelone.removeMovieClip();

       

       

       

      The first time it goes to frame "Back to Shop" as it is supposed to, once I go Back to shop and ToolShopAnim01.swf is loaded and goes to the same code:

       

      _parent.attachMovie("buttonblanklevel", "butt_levelone", 3, {_x: 217, _y: 5});   
          _parent.butt_levelone._alpha = 50;
         
      _parent.butt_levelone.onRelease = function() {
         
          _parent.gotoAndStop("BacktoShop");
      }

       

      IT DOES NOT WORK. Can anyone tell me why? please.

        • 1. Re: Attach movie
          kglad Adobe Community Professional & MVP

          put a trace() in the frame with your attachMovie() method to confirm that code is executing a 2nd time.

          • 2. Re: Attach movie
            juresti Level 1


            _parent.attachMovie("buttonblanklevel", "butt_levelone", 3, {_x: 217, _y: 5});
               
                _parent.butt_levelone._alpha = 50;
               
            _parent.butt_levelone.onRelease = function() {
                _parent.gotoAndStop("BacktoShop");
               trace("people!!!!!!!!!!!!!!!!!!!");
            }

             

            The first time it works and goes back to the label "BacktoShop" and does not trace, the second time it traces and does not go to the frame label.

            • 3. Re: Attach movie
              kglad Adobe Community Professional & MVP

              that onRelease isn't executing the first time, then.

               

              you have some other code causing what you see when that movieclip is clicked.  use movie explorer to find that code if you don't remember where it is.

              • 4. Re: Attach movie
                juresti Level 1

                But it goes to that frame I specify when I click the button.

                 

                _parent.attachMovie("buttonblanklevel", "butt_levelone", 3, {_x: 217, _y: 5});
                   
                    _parent.butt_levelone._alpha = 50;
                   
                _parent.butt_levelone.onRelease = function() {
                    trace("people!!!!!!!!!!!!!!!!!!!");
                    _parent.gotoAndStop("BacktoShop");
                   
                }

                 

                That does trace

                • 5. Re: Attach movie
                  kglad Adobe Community Professional & MVP

                  you said, "The first time it works and goes back to the label "BacktoShop" and does not trace".

                   

                  was that incorrect? it does go to that label and it does trace?

                  • 6. Re: Attach movie
                    juresti Level 1

                    This traces and works 1st time:

                     

                    _parent.butt_levelone.onRelease = function() {
                        trace("people!!!!!!!!!!!!!!!!!!!");
                        _parent.gotoAndStop("BacktoShop");
                       
                    }

                     

                    This does not trace but works 1st time:

                    _parent.butt_levelone.onRelease = function() {
                        _parent.gotoAndStop("BacktoShop");
                            trace("people!!!!!!!!!!!!!!!!!!!");
                    }

                    • 7. Re: Attach movie
                      kglad Adobe Community Professional & MVP

                      copy and paste the output panel text after inserting the following and running through your test steps.

                       

                      /////////////////////

                       

                      var mc:MovieClip=_parent.attachMovie("buttonblanklevel", "butt_levelone", 3, {_x: 217, _y: 5});   
                          _parent.butt_levelone._alpha = 50;

                      trace(mc);

                       

                      _parent.butt_levelone.onRelease = function() {
                          trace("r "+_parent);
                          _parent.gotoAndStop("BacktoShop");
                      }

                      //////////////////////////////////////////////

                       

                      //In frame "BacktoShop" on parent:

                       

                      trace("backtoshop");

                      movieHolder.loadMovie("ToolShopAnim01.swf", "ToolShop");

                       

                      butt_levelone.removeMovieClip();

                       


                      1 person found this helpful
                      • 8. Re: Attach movie
                        juresti Level 1

                        I'm going to try what you said but this works:

                         

                        _parent.butt_levelone.onRelease = function() {
                           
                            _parent.gotoAndPlay(15);
                        }

                         

                        It plays the parent frame which is a few frames before the "BacktoShop" Frame Label I was going back to. It play and then stops on "BacktoShop" where this code is in the frame:

                         

                        stop();

                         

                        movieHolder.loadMovie("ToolShopAnim01.swf", "ToolShop");

                         

                        butt_levelone.removeMovieClip();

                        • 9. Re: Attach movie
                          juresti Level 1

                          first time:

                           

                          _level0.butt_levelone

                          r _level0
                          backtoshop

                           

                          second time:

                           

                          _level0.butt_levelone
                          r _level0

                          • 10. Re: Attach movie
                            kglad Adobe Community Professional & MVP

                            copy and paste the output from:

                             


                            /////////////////////

                             

                            var mc:MovieClip=_parent.attachMovie("buttonblanklevel", "butt_levelone", 3, {_x: 217, _y: 5});   

                                _parent.butt_levelone._alpha = 50;

                            trace(mc);

                             

                            _parent.butt_levelone.onRelease = function() {
                                trace("r "+_parent);
                                _parent.gotoAndStop("BacktoShop");

                            }

                            //////////////////////////////////////////////

                             

                            //In frame "BacktoShop" on parent:

                             

                            trace("backtoshop");

                            //movieHolder.loadMovie("ToolShopAnim01.swf", "ToolShop");

                             

                            butt_levelone.removeMovieClip();

                             


                            1 person found this helpful