9 Replies Latest reply on May 31, 2006 12:03 AM by oopsidazy

    Disabling a button

    oopsidazy
      Hi!

      I am trying to call a movie clip to start when the mouse rolls over a button.
      This is what i wrote:

      on(rollOver) {_root.mcnb.gotoAndPlay(2);}
      on(rollOut){ _root.mcnb.gotoAndPlay(1);}

      the name of my movie clip is mcnb and the first frame on it has a stop().
      the movie starts playing from frame 2 and on.
      what happens is that every time the mouse is over the button, it keeps calling the movie clip to start from fram 2.
      How do i disable the button after the movie clip is called so that it doesnt keep jumping?

      thanx,




        • 1. Re: Disabling a button
          Level 7

          "oopsidazy" <webforumsuser@macromedia.com> wrote in message news:e5bj74$22a$1@forums.macromedia.com...

          > on(rollOver) {_root.mcnb.gotoAndPlay(2);}

          > How do i disable the button after the movie clip is called so that it doesnt
          > keep jumping?

          You could disable the button or just make it so that it only works when the movieclip is on frame 1..

          on(rollOver) {
          if(_root.mcnb._currentframe == 1)
          _root.mcnb.gotoAndPlay(2);
          }

          tralfaz


          • 2. Re: Disabling a button
            oopsidazy Level 1
            thanx so much for your help,
            i tried it and it still doesn't work
            what else can i try?
            • 3. Re: Disabling a button
              Level 7
              "oopsidazy" <webforumsuser@macromedia.com> wrote in message news:e5bk78$347$1@forums.macromedia.com...
              > thanx so much for your help,
              > i tried it and it still doesn't work
              > what else can i try?

              Must be some small mistake in your layout. If you can post a link to your swf file I can look inside it and find out.
              tralfaz


              • 4. Re: Disabling a button
                oopsidazy Level 1
                How can i attach the file here?

                • 5. Re: Disabling a button
                  Level 7
                  "oopsidazy" <webforumsuser@macromedia.com> wrote in message news:e5ef5s$g4e$1@forums.macromedia.com...
                  > How can i attach the file here?

                  It's easier to put the file on your website and post a link to it here.
                  tralfaz


                  • 6. Disabling a button
                    oopsidazy Level 1
                    I can't seem to be using the link you have here on the forum so the address is:
                    www.bentleycardsltd.com > click on cards and it's the flash object you see in the middle.
                    thanx
                    • 7. Re: Disabling a button
                      Level 7
                      "oopsidazy" <webforumsuser@macromedia.com> wrote in message news:e5gkmp$6tj$1@forums.macromedia.com...
                      > <a target=_blank class=ftalternatingbarlinklarge href=" http:// <a
                      > target=_blank class=ftalternatingbarlinklarge
                      > href=" http://www.bentleycardsltd.com/index1.asp?btnPage=1">http://www.bentleycar
                      > dsltd.com/index1.asp?btnPage=1">Here's a link to the website</a>
                      > thank</a>
                      > thank[/L] you so much

                      A single equal sign sets one variable to the value of another. To test to see if something is equal you need two equal signs..

                      // wrong way
                      if (_root.mcnb._currentframe = 1)

                      // right way
                      if (_root.mcnb._currentframe == 1)

                      Another problem is that when b1b opens up mcnb, mcnb expands and covers b1b with another button. That triggers the onRollOut event
                      of b1b. Having buttons on top of buttons can cause problems. I suggest not using the onRollOut event of b1b and replace it with a
                      rollOut event for mcnb instead.
                      When you close mcnb use gotoAndStop(1) instead of gotoAndPlay(1)
                      luck,
                      tralfaz


                      • 8. Re: Disabling a button
                        oopsidazy Level 1
                        Hi!
                        Thanx so much for your help!
                        So the first solution with the == worked but the second solution
                        what i did was, i made an invisible in the movie clip button and placed it over the movie clip and :
                        on(rollOut)
                        {
                        _root.mcsea.gotoAndStop(1);
                        }
                        but the problem is that now when the mouse is over b1b, mcnb is not going up at all
                        Any solutions for that?
                        thanx a bill!!!!!!!

                        • 9. Re: Disabling a button
                          oopsidazy Level 1
                          I tried writing this function on a separate layer in the movie clip but it's not responding
                          mcsea.onRollOut = function()
                          {
                          var x:Number = _currentframe;
                          if (this.x != 1)
                          {this.gotoAndStop(1);}
                          }
                          the movie clip plays and when the mouse rolls out the movie clip doesn't go away
                          can anyone help me?

                          I'm really new at aciton scripts