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();
};
}