16 Replies Latest reply on May 14, 2009 12:06 PM by kglad

    real mind twister (for me anyways:P)

    esco1313 Level 1

      Ok... so i have this movieclip. when i click on the button to get to the frame labeled, it works the first time. however, once it loaded, it doesnt work anymore (when i go in another section, and then click again on the button).

       

      i've had a similar problem in the past... and i think i need to "unload" the movie or something like that.

       

      if anyone could help, it would be apreciated.

      Here's the code...

       

       

      btn3.onRollOver = function() {
          new Tween(hlt, '_y', Strong.easeOut, hlt._y, this._y, 10, false);
         
          this.onPress = function(){
          if(_root.CenterHolder)
          {
          _parent.gotoAndPlay("rollin");
          _root.CenterHolder.onEnterFrame = function() {
              if (_root.CenterHolder._currentframe == 64) {
                  delete this.onEnterFrame;
      _root.CenterHolder.stop();
      _root.gotoAndPlay("gallery");

       

      }
      }
      }

       

      }
      }

        • 1. Re: real mind twister (for me anyways:P)
          kglad Adobe Community Professional & MVP

          unnest your onPress so you have:

           

          btn3.onPress=function(){

           

           

          }

          • 2. Re: real mind twister (for me anyways:P)
            esco1313 Level 1

            what i did (and not working)

             

            btn3.onRollOver = function() {
                new Tween(hlt, '_y', Strong.easeOut, hlt._y, this._y, 10, false);
            }
               
            btn3.onPress = function(){
                if(_root.CenterHolder)
                {
                _parent.gotoAndPlay("rollin");
                _root.CenterHolder.onEnterFrame = function() {
                    if (_root.CenterHolder._currentframe == 64) {
                        delete this.onEnterFrame;
            _root.CenterHolder.stop();
            _root.gotoAndPlay("gallery");

             

            }
            }
            }
            }

             

            when i press the button a second time, it seems to be going to play the next frame after the "gallery" label (being "img1"). And when i press again, it plays the NEXT one ("img2") and so on...

             

            Although i'm convinced its a stupid mistake, i really hope we'll get through this one.

            • 3. Re: real mind twister (for me anyways:P)
              esco1313 Level 1

              ok so i replaced

               

              _root.gotoAndPlay("gallery");

              by

              _root.gotoAndStop("gallery");

               

              now it fixes the problem of playing the next frames. However, the menu still doesnt appear, meaning that it doesnt play the "gallery" frame. Or maybe it does, and perhaps the problem is with THAT animation?

              • 4. Re: real mind twister (for me anyways:P)
                esco1313 Level 1

                updating my research hehe

                 

                the thumbMc doesnt seem to be stopping or unloading, because everytime i press on the btn3 (if it has already been pressed, no matter where i press meanwhile), it plays "thumbOut". seems to me it should get "unloaded" or something like that. i noticed the _root.thumbMc.stop(); is that to clear it from there? or just to stop the animation?

                 

                thanks whoever has the patience.

                • 5. Re: real mind twister (for me anyways:P)
                  kglad Adobe Community Professional & MVP

                  what does thumbMc have to do with anything in your code?

                  • 6. Re: real mind twister (for me anyways:P)
                    esco1313 Level 1

                    sorry. i will explain in details:

                     

                    on my scene, i have a menu which unfolds when clicked. this menu is called "CenterHolder" (which is a mc).

                    in that menu, you have 2 things (to keep my story simple):

                    the "rollin" label (to animate the roll in of the menu when clicked outside of the menu)

                    and

                    a Mc in which all the 5 buttons are. i put my code inside that Mc.

                     

                    now, on the scene, i have the thumbMc (which is the img gallery). this mc is placed in the frame labeled "gallery". so when you hit the btn3, it plays it.

                    (btn3 is a mc)

                    whats happening now is this: when i click on the "btn3" for the first time, it works fine: the menu rolls back up, and the thumbMc appears.

                    When i click on something else, still works fine: the thumbMc disapears ("thumbOut" label), then something else opens.

                    HOWEVER, everytime i click on something else after that, the "thumbOut" plays even if the thumbMc isnt there.

                    And when i click AGAIN on the "btn3", nothing happens.

                    • 7. Re: real mind twister (for me anyways:P)
                      esco1313 Level 1

                      would you like me to send you the fla?

                      • 8. Re: real mind twister (for me anyways:P)
                        kglad Adobe Community Professional & MVP

                        i generally don't download and correct files unless i'm hired to do so.  usually i can help without needing to debug source files but i'm afraid your situation is getting more complex than i can be help in a forum.

                        • 9. Re: real mind twister (for me anyways:P)
                          esco1313 Level 1

                          ok thanks anyways! i'll try to fix it (which is highly unprobable:P)

                          if, however, u have a flash (idea), let me know!

                          • 10. Re: real mind twister (for me anyways:P)
                            kglad Adobe Community Professional & MVP

                            you're welcome.  and good luck.

                             

                            your best bet is to try and pinpoint the problem.  then you can get help.

                            • 11. Re: real mind twister (for me anyways:P)
                              esco1313 Level 1

                              i really think that the problem is that the thumbMc  doesnt unload...can we "delete or erase" a mc?

                              and in the following code, is there something wrong?

                               

                              btn2.onRollOver = function() {
                                  new Tween(hlt, '_y', Strong.easeOut, hlt._y, this._y, 10, false);
                                  this.onPress = function(){
                                      if(_root.thumbMc)
                                  {
                              _root.thumbMc.gotoAndPlay("thumbOut");
                              _root.thumbMc.onEnterFrame = function() {
                              if (_root.thumbMc._currentframe == 31) {
                              delete this.onEnterFrame;
                              _root.thumbMc.stop();
                              loadMovie("cocktail.swf","screen");
                              }
                              }
                              }
                              else {
                              loadMovie("cocktail.swf","screen");
                              }
                              }

                              }

                               

                              btn3.onRollOver = function() {
                                  new Tween(hlt, '_y', Strong.easeOut, hlt._y, this._y, 10, false);
                              }
                                 
                              btn3.onPress = function(){
                                  if(_root.CenterHolder)
                                  {
                                  _parent.gotoAndPlay("rollin");
                                  _root.CenterHolder.onEnterFrame = function() {
                                      if (_root.CenterHolder._currentframe == 64) {
                                          delete this.onEnterFrame;
                              _root.CenterHolder.stop();
                              _root.gotoAndStop("gallery");

                               

                              }
                              }
                              }
                              }

                              • 12. Re: real mind twister (for me anyways:P)
                                kglad Adobe Community Professional & MVP

                                you can remove a movieclip (which deletes it) by using

                                 

                                mc.removeMovieClip();  // if the movieclip is at a removable depth (0 to 2**20)

                                 

                                and you can use mc.swapDepths() to move a movieclip to a removable depth.

                                • 13. Re: real mind twister (for me anyways:P)
                                  esco1313 Level 1

                                  ok i found out something...

                                   

                                  the thumbMc is still there even if i dont see it: i can still click on it!!

                                   

                                  whats in bold is what i'd like to achieve...
                                  this code here:

                                   

                                  btn1.onRollOver = function() {
                                      new Tween(hlt, '_y', Strong.easeOut, hlt._y, this._y, 10, false);
                                      this.onPress = function(){
                                              if(_root.thumbMc)                                                                 // if thumbMc is loaded
                                      {
                                  _root.thumbMc.gotoAndPlay("thumbOut");                                      // play the thumbOut
                                  _root.thumbMc.onEnterFrame = function() {                                  
                                  if (_root.thumbMc._currentframe == 31) {                                       // when it finishes, remove thumbMc
                                  delete this.onEnterFrame;
                                  _root.thumbMc.stop();                                                                    // then play this movie
                                  loadMovie("propos_sarahb.swf","screen");
                                  }
                                  }
                                  }
                                  else {
                                  loadMovie("propos_sarahb.swf","screen");                                        // if its NOT loaded, play this movie.
                                  }
                                  }
                                  }

                                   

                                  how would i make that happen? i tried adding _root.thumbMc.removeMovieClip(); but its not right, right?

                                  • 14. Re: real mind twister (for me anyways:P)
                                    kglad Adobe Community Professional & MVP

                                    if you're not using any components, try:

                                     

                                    esco1313 wrote:

                                     

                                    ok i found out something...

                                     

                                    the thumbMc is still there even if i dont see it: i can still click on it!!

                                     

                                    whats in bold is what i'd like to achieve...
                                    this code here:

                                     

                                    btn1.onRollOver = function() {
                                        new Tween(hlt, '_y', Strong.easeOut, hlt._y, this._y, 10, false);
                                        this.onPress = function(){
                                                if(_root.thumbMc)                                                                  // if thumbMc is loaded
                                        {
                                    _root.thumbMc.gotoAndPlay("thumbOut");                                      // play the thumbOut
                                    _root.thumbMc.onEnterFrame = function() {                                  
                                    if (_root.thumbMc._currentframe == 31) {                                       // when it finishes, remove thumbMc
                                    delete this.onEnterFrame;
                                    _root.thumbMc.swapDepths(_root.getNextHighestDepth());

                                    _root.thumbMc.removeMovieClip();                                                                 // then play this movie
                                    loadMovie("propos_sarahb.swf","screen");
                                    }
                                    }
                                    }
                                    else {
                                    loadMovie("propos_sarahb.swf","screen");                                        // if its NOT loaded, play this movie.
                                    }
                                    }
                                    }

                                     

                                    how would i make that happen? i tried adding _root.thumbMc.removeMovieClip(); but its not right, right?

                                    1 person found this helpful
                                    • 15. Re: real mind twister (for me anyways:P)
                                      esco1313 Level 1

                                      very nice. so that worked! Now my LAST question regarding this issue...

                                       

                                      for some reason, i had to push my animation 1 frame further than the labeled frame.. its not the first time it does this.. anyways.

                                       

                                      thanks dude.

                                      • 16. Re: real mind twister (for me anyways:P)
                                        kglad Adobe Community Professional & MVP

                                        you're welcome.