only thing puzzling me is how to stop the movement when the last “planet”
comes on stage. i tried several options including math.min and math.max, making t false, … but couldn’t fix it. :puzzle: Should i assign a new variable or function?? help me … Here’s the main AS code in my flash movie so far:
stop();
myPath = new Path(543, -110);
myPath.curveTo(625, -62, 659, 0);
myPath.curveTo(678, 34, 679, 73);
myPath.curveTo(670, 200, 524, 271);
myPath.curveTo(416, 325, 296, 348);
myPath.curveTo(182, 370, 76, 367);
myPath.curveTo(35, 367, 0, 365);
myPath.curveTo(-88, 359, -168, 340);
t = 0;
function mcSpeed() {
var vAngle:Number;
vAngle = Math.round(Math.atan(_ymouse/_xmouse)*180/Math.PI)-45;
if (_xmouse<=0) {
vAngle = 0;
}
if (_ymouse<=0) {
vAngle = 0;
}
updateAfterEvent();
}
var clipInterval:Number = setInterval(mcSpeed, 10);
this.onEnterFrame = function() {
t += -(vAngle/45)
myPath.traverse(this.mcOglas1, t*.04, false, false);
myPath.traverse(this.mcOglas2, (t-5)*.04, false, false);
myPath.traverse(this.mcOglas3, (t-10)*.04, false, false);
myPath.traverse(this.mcOglas4, (t-15)*.04, false, false);
myPath.traverse(this.mcOglas5, (t-20)*.04, false, false);
myPath.traverse(this.mcOglas6, (t-25)*.04, false, false);
myPath.traverse(this.mcOglas7, (t-30)*.04, false, false);
}
mcOglas1 thru 7 are the planets :D.
I want to make it so that, when the last planet comes to position, lets say y = 100, the movement stops in clockwise motion. The same for when the first planet goes offstage to a position of y= -80 that the movement stops in counterclockwise motion.