Note that there are some explanatory texts on larger screens.

plurals
  1. POhow do I either stop the tween at the point of my choice (first code)? or how do I stop the easing (second code)?
    primarykey
    data
    text
    <p><em>This is for <code>Actionscript 3.0</code> on <code>CS5</code>. I've been having some issues with <code>fl.transitions.easing.None.easeNone.</code> I tried to animate my MovieClip character without easing and stopping on a dime. I used the following code to stop the easing:</em></p> <pre><code>stage.addEventListener(KeyboardEvent.KEY_DOWN, keyPressed); function keyPressed(evt:KeyboardEvent):void { if(evt.keyCode == Keyboard.RIGHT &amp;&amp; var_move == false) { var_move = true; hero.gotoAndStop("Walk"); hero.scaleX = 1; var tween1:Tween = new Tween(hero, "x", None.easeNone, hero.x, hero.x+75, 15, false) tween1.addEventListener(TweenEvent.MOTION_FINISH, onMotionFinished); } if(evt.keyCode == Keyboard.LEFT &amp;&amp; var_move == false) { var_move = true; hero.gotoAndPlay("Walk"); hero.scaleX = -1; var tween2:Tween = new Tween(hero, "x", None.easeNone, hero.x, hero.x-75, 15, false) tween2.addEventListener(TweenEvent.MOTION_FINISH, onMotionFinished); } } function onMotionFinished($evt:TweenEvent):void { hero.gotoAndPlay("Stand"); var_move = false; } </code></pre> <p><em>Which it did but if you just tap Right or Left Arrow the MovieClip character will not stop on that frame. It continues until the tween is done. If I use the following code:</em></p> <pre><code>stage.addEventListener(KeyboardEvent.KEY_DOWN, keyPressed); stage.addEventListener(KeyboardEvent.KEY_UP, releaseKey); function keyPressed(evt:KeyboardEvent):void { if(evt.keyCode == Keyboard.RIGHT) { var_move = true; hero.gotoAndPlay("Walk"); hero.scaleX = 1; hero.x += 5; } if(evt.keyCode == Keyboard.LEFT) { var_move = true; hero.gotoAndPlay("Walk"); hero.scaleX = -1; hero.x -= 5; } } function releaseKey(evt:KeyboardEvent):void { if(evt.keyCode == Keyboard.RIGHT || evt.keyCode == Keyboard.LEFT) { hero.gotoAndStop("Stand"); } } </code></pre> <p><em>the MovieClip character eases into the walk animation, but stops where I want it to. how do I either stop the tween at the point of my choice (first code) or how do I stop the easing (second code)?</em></p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload