PDA

View Full Version : [FMX] Sliding



JasonX
December 2nd, 2002, 01:27 AM
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

lostinbeta
December 2nd, 2002, 01:32 AM
Did you see this tutorial ??

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

JasonX
December 2nd, 2002, 02:12 AM
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

lostinbeta
December 2nd, 2002, 02:18 AM
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;

JasonX
December 2nd, 2002, 05:27 AM
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.

lostinbeta
December 2nd, 2002, 12:45 PM
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....

JasonX
December 2nd, 2002, 09:50 PM
LostinBeta: that was exactly what I wanted to do. Thanks +karma to you.

lostinbeta
December 2nd, 2002, 09:57 PM
No problem :)

Ryall
December 3rd, 2002, 12:55 PM
Sweet Lost, you got more karma out of the deal - awesome. :)

Peace

lostinbeta
December 3rd, 2002, 12:57 PM
lol, saaweeeeeeet!!!!!!!!

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


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