5 Replies Latest reply on Jul 8, 2006 9:43 AM by jp zoro

    Button problem

    jp zoro
      Hi,
      I've made three 'Joker' buttons in frame 5. I want these to stay down when they've been hit (which I've done) but now I don't know how to make the Joker move the timeline onto 'nextframe'. You can see the current version of this at http://jpriordan.mysite.wanadoo-members.co.uk/Plenaries/plenary_letters.htm
      I'm new to Flash and teaching myself as I go along. Sorry if this is something really basic!

      Thanks for your help.



      Here is the exported flash.
      http://jpriordan.mysite.wanadoo-members.co.uk/Plenaries/plenary_letters.htm

      Can I put the .fla on this forum so you can have a look?
        • 1. Button problem
          PDMart
          A suppose an easy way to do this would to be to click on each joker button and view the actions for that button (F9 on a pc). Then in the actions, type in the following code, depending on your prefference:

          on(release){
          gotoAndPlay(6);
          }

          You can change it to " on(press)" if that's what you want or you can change it to "gotoAndStop(6)" if that is the desired effect.

          I'm no expert on flash so hopefully i didn't tell you something completely wrong =)

          Edit: I believe you can also replace the frame "(6)" with "next"
          • 2. Re: Button problem
            jp zoro Level 1
            Many thank for your reply PDMart.

            My problem is that I needed to use a Movie Clip with three frames in it (the third of which is 'hit') not a button as I wanted to the 'button' to stay pressed when it had been hit. Does that make sense? When I double click on the Joker and go to the third frame I've put nextFrame(); in the actions but this doesn't take me to the next frame of the normal timeline.

            Best wishes,
            Zoro
            • 3. Re: Button problem
              PDMart Level 1
              I think what you need to do is to put the actionscript on your instance of the joker Movie Clips in the actual stage, not in frame 3 of your Movie Clip. So where you see in your stage your 3 jokers, click on each one and in the actions panel put in the required code, which should be something like
              on(press){
              gotoAndStop(next);
              }
              • 4. Re: Button problem
                jp zoro Level 1
                Hi,
                I've tried what you suggested but it isn't working yet. I'm probably doing something dum as I'm new to Flash.

                Here is the code I've got on the Joker button in an 'actions' layer which works to keep the joker pressed:

                stop();
                this.onRollover = function() {
                gotoAndStop(2);
                };
                this.onRollOut = this.onDragOut=function () {
                if (this.selected != true) {
                gotoAndStop(1);
                this.selected = false;
                }
                };
                this.onPress = function() {
                gotoAndStop(3);
                this.selected = true;
                };

                Thanks!
                Zoro
                • 5. Re: Button problem
                  jp zoro Level 1
                  I got it sorted:

                  on (release) {
                  with (_level0) {
                  nextFrame();
                  }
                  }