1 Reply Latest reply on Oct 15, 2011 10:44 AM by Ned Murphy

    Button dispersing - Alpha tween

    sunflexm

      Hi again

       

      I've got the following code.

      And I want formTest to disperse on fl_MouseOutHandler, formTest is now just set to visible false and thats also what I actually want, but I want the formTest to disapear more gently. I don't know, but what kind of tween or animation do I need. Alpha tween? How to implement it?

       

      import flash.utils.Timer;

      import flash.events.TimerEvent;

      var timer:Timer;

       

      testForm.visible = false;

       

      timer = new Timer(300,1);

      timer.addEventListener(TimerEvent.TIMER, eventTime);

       

      /* Mouse-Over-Ereignis */

      button.addEventListener(MouseEvent.MOUSE_OVER, fl_MouseOverHandler);

       

      function fl_MouseOverHandler(event:MouseEvent):void

      {

          trace("Mouse-Over erfolgt");

          timer.start();

       

          var myColor:ColorTransform = button.transform.colorTransform;

          myColor.color = 0xFF0000;

          button.transform.colorTransform = myColor;

      }

       

      function eventTime(e:TimerEvent)

      {

          testForm.visible = true;

          button.visible = false;

      }

       

      /* Mouse-Out-Ereignis */

      testForm.addEventListener(MouseEvent.MOUSE_OUT, fl_MouseOutHandler);

       

      function fl_MouseOutHandler(event:MouseEvent):void

      {

          trace("Mouse-Out erfolgt");

          testForm.visible = false;

          button.visible = true;

      }

       

      /* Mouse-Out-Ereignis */

      button.addEventListener(MouseEvent.MOUSE_OUT, fl_MouseOutHandler_2);

       

      function fl_MouseOutHandler_2(event:MouseEvent):void

      {

              timer.stop();

      }