1 Reply Latest reply on May 26, 2010 10:17 AM by Ned Murphy

    newbie here! click appear click again diappear?

    alanbarry1

      Hi, Im new to this so HELP!!! ive got an object to appear when i click a button and i want it to disappear when the same button is clicked again! heres the code i used:

       

                  moreInfo.onRelease = function()
                  {
                      var tw:Tween = new Tween(keyTech,"_alpha",Strong.easeOut,0,100,1,true);
                  }

       

      Please Help

        • 1. Re: newbie here! click appear click again diappear?
          Ned Murphy Adobe Community Professional & MVP

          You could try something like...

           

          var alphaToBe = 100;

           

          moreInfo.onRelease = function()
          {

               var tw:Tween = new Tween(keyTech,"_alpha",Strong.easeOut,keyTech._alpha,alphaToBe,1,true);

               if(alphaToBe == 100){

                    alphaToBe = 0;

               } else {

                    alphaToBe = 100;

               }

          }

           

          I use keyTech._alpha as the starting point for the tween just so that it starts wherever it currently is.