# \[FMX\] Sliding

**URL:** https://forum.kirupa.com/t/fmx-sliding/8978
**Category:** flash
**Created:** [December 2, 2002, 6:27am UTC](https://forum.kirupa.com/t/fmx-sliding/8978 "2002-12-02T06:27:54Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![JasonX](https://avatars.discourse-cdn.com/v4/letter/j/fbc32d/32.png) [@JasonX](https://forum.kirupa.com/u/JasonX)
#### Post date: [December 2, 2002, 6:27am UTC](https://forum.kirupa.com/t/fmx-sliding/8978/1 "2002-12-02T06:27:54Z")

</div>

on (release)  
\_root.cadbury.\_x=\_root.dist+\_root.spac  
)

How do I make this slide to its new position at a certain speed? I have seen the tutorial here on Kirupa on getting a square to keep moving but I am uncertain how to apply this to the code above as I want it to stop at the point above.

Can someone tell me if it is possible.

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: [December 2, 2002, 6:32am UTC](https://forum.kirupa.com/t/fmx-sliding/8978/2 "2002-12-02T06:32:43Z")

</div>

Did you see this tutorial ??

[http://www.kirupa.com/developer/mx/easing\_mouseclick.asp](http://www.kirupa.com/developer/mx/easing_mouseclick.asp)

---

<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: [December 2, 2002, 7:12am UTC](https://forum.kirupa.com/t/fmx-sliding/8978/3 "2002-12-02T07:12:52Z")

</div>

onClipEvent (enterFrame) {  
\_root.cadbury.\_x+=(\_root.dist+\_root.spac)/5  
}

This gives me the sliding effect I want but it doesnt work when you change it to MouseDown or MouseUp.

onClipEvent (load) {  
\_x = 13.5;  
speed = 4;  
}  
onClipEvent (mouseDown) {  
endX = 350;  
}  
onClipEvent (enterFrame) {  
\_root.cadbury.\_x += (ensX-\_x)/speed;  
}

Can anyone help

thanls

---

<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: [December 2, 2002, 7:18am UTC](https://forum.kirupa.com/t/fmx-sliding/8978/4 "2002-12-02T07:18:55Z")

</div>

Look at your last onClipEvent(enterFrame)

You have

\_root.cadbury.\_x += (en\<B\>s\</B\>X-\_x)/speed;

When it should be

\_root.cadbury.\_x += (en\<B\>d\</B\>X-\_x)/speed;

---

<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: [December 2, 2002, 10:27am UTC](https://forum.kirupa.com/t/fmx-sliding/8978/5 "2002-12-02T10:27:45Z")

</div>

That still doesn’t work.

It works for the movie you are performing the slide on.

But I want to slide 15 other movies by clicking on one movie.

With this code using mouse down you can click anywhere within the while movie and it activates.

Example:

I have two movies with instance names button1 and button2

The following is placed on button1

onClipEvent (load) {  
\_x = 0;  
speed = 5;  
}  
on (press) {  
endX = 100;  
}

onClipEvent (enterFrame) {  
\_root.button2.\_x += (endX-\_x)/speed;  
}

It will slide button2 indefinitely. I need it to stop at some point.

But if I leave it as button1

onClipEvent (load) {  
\_x = 0;  
speed = 5;  
}  
on (press) {  
endX = 100;  
}

onClipEvent (enterFrame) {  
\_root.button1.\_x += (endX-\_x)/speed;  
}

It work’s as intended.

---

<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: [December 2, 2002, 5:45pm UTC](https://forum.kirupa.com/t/fmx-sliding/8978/6 "2002-12-02T17:45:42Z")

</div>

Ok, I have attached a file with something that I think you are trying to do (well not exactly, but something that might set you on the right path).

Let me know if it helps…

---

<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: [December 3, 2002, 2:50am UTC](https://forum.kirupa.com/t/fmx-sliding/8978/7 "2002-12-03T02:50:38Z")

</div>

LostinBeta: that was exactly what I wanted to do. Thanks +karma to you.

---

<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: [December 3, 2002, 2:57am UTC](https://forum.kirupa.com/t/fmx-sliding/8978/8 "2002-12-03T02:57:48Z")

</div>

No problem 🙂

---

<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: [December 3, 2002, 5:55pm UTC](https://forum.kirupa.com/t/fmx-sliding/8978/9 "2002-12-03T17:55:45Z")

</div>

Sweet Lost, you got more karma out of the deal - awesome. 🙂

Peace

---

<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: [December 3, 2002, 5:57pm UTC](https://forum.kirupa.com/t/fmx-sliding/8978/10 "2002-12-03T17:57:50Z")

</div>

lol, saaweeeeeeet!!!

::might be an inside joke… not sure::

I think I am beginning to get really good at easing…lol.
