5 Replies Latest reply on Feb 27, 2011 6:52 PM by Ned Murphy

    I need to get the invisible button to go to a frame

    FlashRenaissance

      I am narrowing it down a little.

       

      I have invisible buttons on a movie clip that is loading swfs onto a parent movie clip. I hope I am current in the terminology. Are a parent and root the same? Is saying root absolute and parent relative? I'm digressing.

       

      So, this this._parent.gotoAndPlay("contact form"); is going to the keyframe named "contact form" and it will stop there. What I want to happen, is, I want the other invisible button named aboutmeMC2 to go back to the keyframe named "skip" so my contact form will no longer show up and it will load the external swf.

       

      I hope that's clear.

       

      Thanks

       

      Actionscript Code:
      on (release) {

          this._parent.gotoAndPlay("contact form");
          aboutmeMC2._root.gotoAndPlay("skip");

      }
        • 1. Re: I need to get the invisible button to go to a frame
          Ned Murphy Adobe Community Professional & MVP

          Your description is confusing, so I will just hazard a guess that what you want would be...

           

          on (release) {
              _parent.gotoAndPlay("contact form");
              _root.aboutmeMC2gotoAndPlay("skip");
          }

           

          _root points to the main timeline of a Flash file.  _parent refers to the timeline of whatever contains the object who's _parent is being targeted

          1 person found this helpful
          • 2. Re: I need to get the invisible button to go to a frame
            FlashRenaissance Level 1

            No that's not working. It should but it's not.

            I want it to load the external swf. When I tell it to go to the "skip" label in the parent timeline, that's where this code is. So maybe it should tell it to load the external swf?

            By the way, thanks for the feedback. You're the only person out of any of the forums to answer so far.

             

            this.CreateEmptyMovieClip("blank_mc",10);

            with(blank_mc){

            _x = -450;

            _y= -225;

            0;

            }

            loadMovie("welcome.swf",blank_mc);

             

             

            stop();

            • 3. Re: I need to get the invisible button to go to a frame
              Ned Murphy Adobe Community Professional & MVP

              Maybe you should settle in to getting away from placing code on objects and use the timeline instead.  Placing code on objects is a discouraged practice.  When you have the code in the timeline, not only is it easy to find, things are clearer as far as how to go about targeting objects.

               

              Instead of using

               

              on(release){  // or on(anything...)

                   ...

              }

               

              give the object an instance name and use timeline code instead...

               

              objectName.onRelease = function(){

                   ...

              }

              • 4. Re: I need to get the invisible button to go to a frame
                FlashRenaissance Level 1

                Ned you are right! I remember a video tutorial telling me the same thing years ago.

                Let me see if I have this right. Buy putting all the AS2 on a timeline instead of the object (invisible button) I will probably eliminate these problems I am running into?

                 

                Can I put all the AS2 on the first keyframe even though the invisible buttons are several movie clips deep into the flash? This sounds complicated. But if it will fix this problem I am willing to learn. Any suggestions on where I can find a tutorial t do this?

                • 5. Re: I need to get the invisible button to go to a frame
                  Ned Murphy Adobe Community Professional & MVP

                  If your buttons are located somewhere down a timeline, the code needs to be where the buttons are.  One benefit of having code on the timeline is that you have a more certain reference point for targeting objects.  Another benefit is that your code is not hidden all over the place, leaving you to have to search every object for different bits and pieces.

                  1 person found this helpful