2 Replies Latest reply on Feb 25, 2016 11:00 AM by Colin Holgate

    I need "TweenEvent.MOTION_FINISH" flash as3 code converted to html5 canvas code

    productionArtistChad Level 1

      I use a lot of "TweenEvent.MOTION_FINISH" in flash AS3 and moving forward to html5 canvas I need to have code to do the same thing. does anyone know how code this for html5 canvas? the code below just moves something along the X axis 500 pixels over 230 frames and on motion_finish it moves it 50 more pixels with a different easing. I use this for other things like telling a different movie clip to move or fade when another clip is done.

       

      import fl.transitions.Tween;

      import fl.transitions.easing.None;

      import fl.transitions.easing.Regular;

      import fl.transitions.TweenEvent

       

      var myTween:Tween;

      var squarex:Tween;

       

      function squareEnter() :void{

       

      myTween= new Tween(textLineOne, "x", None.easeInOut, textLineOne.x, textLineOne.x+500, 230, false);

      myTween.addEventListener(TweenEvent.MOTION_FINISH,finishF);

      }

       

      function finishF(e:TweenEvent):void {

       

      squarex = new Tween(textLineOne, "x", Regular.easeOut, textLineOne.x, textLineOne.x+50, 40, false);

      }

       

      squareEnter();