[FMX] Sliding

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

Did you see this tutorial ??

http://www.kirupa.com/developer/mx/easing_mouseclick.asp

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

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;

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.

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…

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

No problem :slight_smile:

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

Peace

lol, saaweeeeeeet!!!

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

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