5 Replies Latest reply on Jan 6, 2010 3:24 PM by kglad

    Slide in box issue

    Bozzer1515

      Hi

       

      I'm working in 2.0 and at the moment I have 2 boxes that I want to slide in, each is on a different timeline. One is set up to start on frame 1 and the other to start on frame 21 so as not to play together when their associated button is pressed. My problem is that when I click on the first button to play the box sliding in on frame 1 it does its job and then when I press the button again it disappears, which is fine it just doesn;t do that for my 2nd button that starts on frame 21. It will slide out but when i click on the button again it just slides out again and does not disappear which is what I want it to do.

       

      Please help thank you

        • 1. Re: Slide in box issue
          kglad Adobe Community Professional & MVP

          it sounds like their both on the same timeline.  did you mean they are in different layers?


          show your buttons' code.

          • 2. Re: Slide in box issue
            Bozzer1515 Level 1

            Sorry, they are on different layers and the script I have for the buttons is this:

             

            Button 1 that activates frame 1:

             

            on (release) {
            gotoAndPlay(1);
            }
            on (release) {
            play();
            }

            Button2 that activates frame21

             

            on (release) {
            gotoAndPlay(21);
            }

            • 3. Re: Slide in box issue
              kglad Adobe Community Professional & MVP

              copy the frame frames 1-20 (or whatever frames display your box sliding out and then back).  click insert/new symbol and tick movieclip/ok.  on that timeline right click the first frame and then left click paste frames.

               

              go back to the main timeline and copy frames 21-? (wherever the 2nd box ends its slide back).   click insert/new symbol and tick movieclip/ok.  on that timeline right click the first frame and then left click paste frames.

               

              go back to your main timeline and remove all those frames.

               

              right click the box that corresponds to Button 1, click linkage, tick export for actionscript and assign a linkage id - say box1ID.

               

              right click the box that corresponds to Button 2, click linkage, tick export for actionscript and assign a linkage id - say box2ID.

               

              Button 1:

               

              on(release){

              if(!box1MC){

              var mc:MovieClip=attachMovie("box1ID","box1MC",1);

              mc.play();

              } else {

              box1MC.play();

              }

              }

               

               

              Button 2:

               

              on(release){

              if(!box2MC){

              var mc:MovieClip=attachMovie("box2ID","box2MC",1);

              mc.play();

              } else {

              box2MC.play();

              }

              }

              • 4. Re: Slide in box issue
                Bozzer1515 Level 1

                thank you so much, you are a genius! cheers

                • 5. Re: Slide in box issue
                  kglad Adobe Community Professional & MVP

                  you're welcome.