# Easing in AND out?

**URL:** https://forum.kirupa.com/t/easing-in-and-out/18031
**Category:** Uncategorized
**Created:** [April 12, 2003, 10:51am UTC](https://forum.kirupa.com/t/easing-in-and-out/18031 "2003-04-12T10:51:05Z")
**Posts on this page:** 12
**Page:** 1

<div class="post-metadata">

### Author: ![Flashmatazz](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/flashmatazz/32/140_2.png) [@Flashmatazz](https://forum.kirupa.com/u/Flashmatazz)
#### Post date: [April 12, 2003, 10:51am UTC](https://forum.kirupa.com/t/easing-in-and-out/18031/1 "2003-04-12T10:51:05Z")

</div>

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?? 🙂

Cheers.

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [April 12, 2003, 11:47am UTC](https://forum.kirupa.com/t/easing-in-and-out/18031/2 "2003-04-12T11:47:00Z")

</div>

something like [this](http://its-just-a-test.i8.com/spinny_thingie.html)?

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

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [April 12, 2003, 12:10pm UTC](https://forum.kirupa.com/t/easing-in-and-out/18031/3 "2003-04-12T12:10:07Z")

</div>

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!

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [April 12, 2003, 12:17pm UTC](https://forum.kirupa.com/t/easing-in-and-out/18031/4 "2003-04-12T12:17:39Z")

</div>

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 🙂

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [April 12, 2003, 12:50pm UTC](https://forum.kirupa.com/t/easing-in-and-out/18031/5 "2003-04-12T12:50:12Z")

</div>

I actually seem to understand the code which makes me happy 🙂

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.

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [April 13, 2003, 9:28am UTC](https://forum.kirupa.com/t/easing-in-and-out/18031/6 "2003-04-13T09:28:18Z")

</div>

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

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [April 13, 2003, 9:31am UTC](https://forum.kirupa.com/t/easing-in-and-out/18031/7 "2003-04-13T09:31:24Z")

</div>

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

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [April 13, 2003, 9:33am UTC](https://forum.kirupa.com/t/easing-in-and-out/18031/8 "2003-04-13T09:33:56Z")

</div>

thanks! 🙂

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [April 13, 2003, 9:56am UTC](https://forum.kirupa.com/t/easing-in-and-out/18031/9 "2003-04-13T09:56:13Z")

</div>

i did it :beam:

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [April 13, 2003, 10:51am UTC](https://forum.kirupa.com/t/easing-in-and-out/18031/10 "2003-04-13T10:51:28Z")

</div>

: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:

```auto

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

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [April 14, 2003, 1:27am UTC](https://forum.kirupa.com/t/easing-in-and-out/18031/11 "2003-04-14T01:27:43Z")

</div>

use this code instead

```auto
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 ☹

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [April 14, 2003, 11:31am UTC](https://forum.kirupa.com/t/easing-in-and-out/18031/12 "2003-04-14T11:31:45Z")

</div>

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