# How do I stop an mx.transition?

**URL:** <https://forum.kirupa.com/t/how-do-i-stop-an-mx-transition/223207>\
**Category:** flash\
**Created:** [April 20, 2007, 9:31am UTC](https://forum.kirupa.com/t/how-do-i-stop-an-mx-transition/223207 "2007-04-20T09:31:36Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![creativecog](https://avatars.discourse-cdn.com/v4/letter/c/eb8c5e/32.png) [@creativecog](https://forum.kirupa.com/u/creativecog)\
**Post date:** [April 20, 2007, 9:31am UTC](https://forum.kirupa.com/t/how-do-i-stop-an-mx-transition/223207/1 "2007-04-20T09:31:36Z")

</div>

Hi all… new to this forum, but it looks pretty good so far !!!

I have set up a function - moveEarth - which essentially move an image from left to right - off the screen and then back to the left hand position and off again… works a treat but how do I stop it… I have tried multiple variations of…

btnStop\_mc.onRelease = function() {  
moveEarth.onMotionFinished.stop();  
trace(“Stop”);  
};

Many thanks,

// Initial Settings  
stop();  
import mx.transitions._;  
import mx.transitions.easing._;  
// Image Starting Positions  
earth\_mc.\_x = -300;  
// The Tween Time To Move To The Next Position  
var tweenTime = 3;  
// The Tween Distance To Move Each Time  
var tweenDist = 1200;  
// Movement Function  
function moveEarth() {  
var tweenMC1 = earth\_mc;  
tweenType = Regular.easeOut;  
tweenBegin1 = tweenMC1.\_x;  
tweenEnd1 = tweenBegin1+tweenDist;  
var leftTween1:Tween = new Tween(tweenMC1, “\_x”, tweenType, tweenBegin1, tweenEnd1, tweenTime, true);  
leftTween1.onMotionFinished = function() {  
earth\_mc.\_x = tweenBegin1;  
moveEarth();  
};  
}
