Easing in AND out?

Just wondering,

can anyone point me in a direction as of how to use AS to create movement with easing in AND out?

I was trying to get an mc spin according to the speed of the mouse. So when I move my mouse quickly, the object starts spinning faster and faster, but after reaching it’s maximum speed, it slows down again.

Maybe LiB, if your bored again?? :slight_smile:

Cheers.

something like this?

im not sure if that’s what youre looking for, but i attached the source file anyways :slight_smile:

That’s really great!

I have to dive into it for a while to try and understand what all the AS is doing.
If I have any further questions, can I come back to you about this?

Thanks a lot!

sure… only thing is, i came up with it very co-incidentially, i didnt know what was i doing :beam:… i’ll still be able to help ya though :slight_smile:

I actually seem to understand the code which makes me happy :slight_smile:

However, one question: this only uses easing out, right?

I mean, the rotation and moving speed start high and gradually slow down.
But would it be possible to have the speed increase gradually at first as well? (do I make any sense?)

Thanks.

so…does this mean it isn’t possible??

oh… sorry… i didnt notice your previous post, i’ll look into it =)

thanks! :slight_smile:

i did it :beam:

:cool: Thanks a lot Ahmed!

One more thing I’m trying to do now:

if the wheel is speeding up because it’s getting to it’s target and you move the mouse just a little, the movement is slowed down completely again because of the:


onMouseMove = function() {
	num = 100;
}

Still breaking my head on it…

p.s. I hope I’m not being too much of a pain in the b*tt

use this code instead

num = 100;
onMouseMove = function () {
	if (myvariable) {
		num = 100;
	}
};
// easing factor
/* |||||||||||||||||||||||||||||||||||||||||||||| */
onEnterFrame = function () {
	if (num<5) {
		num = 4;
		myvariable = true;
	} else {
		num -= 4;
		myvariable = false;
	}
	trace(num);
	difference = _xmouse-circle._x;
	circle._x += difference/num;
	circle._rotation += difference/num;
	myText = "Slipperiness: "+(num-4);
	pointer._x = _xmouse;
	mc = this.createEmptyMovieClip("lines", 1);
	with (lines) {
		lineStyle(0, 0xFF6600);
		moveTo(_root.circle._x, _root.circle._y);
		lineTo(_root.pointer._x, _root.pointer._y);
		lineStyle(0, 0xFF6600);
		moveTo(_root.circle._x, _root.circle._y+4);
		lineTo(_root.pointer._x, _root.pointer._y+4);
	}
};

It’s kind of buggy though :frowning:

Thanks again. I will try it out when I get back home.