1 Reply Latest reply on Jun 13, 2009 10:55 PM by kglad

    Newbie needs help with AS2 tween class and buttons.

    EverLightMusic

      This should be a pretty easy problem for you guys. Basically, I'm trying to create a button with the tween class in actionscript 2.0 but it confuses the hell out of me. At the moment I have a movieclip symbol called button1, and inside that symbol there are two layers, one has the button graphic on it, and the other has a circle (with an instance name of btncover) which I want to slide up onto the button graphic when the mouse is moved over the button, and slide back down when it is moved away. Clicking the button should take you to frame 2 of the main timeline.

       

      It sounds like it should be easy but I've been looking for a solution everywhere and I can't find anything. Hopefully you guys can help

       

      Thanks!

        • 1. Re: Newbie needs help with AS2 tween class and buttons.
          kglad Adobe Community Professional & MVP

          import mx.transitions.Tween;
          var tw:Tween

           

          // btncover starting _y
          button1.btncoverStartY = button1.btncover._y;
          // btncover end _y.  this probably isn't correct.  adjust as needed
          button1.btncoverEndY = button._y

           

          button1.onRollOver=function(){
          tw = new Tween(this.btncover, "_y", mx.transitions.easing.Elastic.easeOut,this.btncover._y, this.btncoverEndY, 1, true);
          }

           

          button1.onRollOut=function(){
          tw = new Tween(this.btncover, "_y", mx.transitions.easing.Elastic.easeOut,this.btncover._y, this.btncoverStartY, 1, true);
          }