PDA

View Full Version : smooth motions



catreya
May 26th, 2003, 02:15 AM
hello,

i am working on moving an object smoothly from point A to point B. I am attaching the fla file. While the object moves on a button click, its not smooth but just jumps from A to B.

i have been at it for days and cant figure out how. I want to use the for loop and not the clipEvent (enterframe) way.

thanx

pom
May 26th, 2003, 12:34 PM
for loops are executed within the SAME FRAME! That's why you don't see anything (Flash refreshed when all the code has been executed).

I haven't checked the fla, but that's probably the problem.

catreya
May 26th, 2003, 01:26 PM
Thanks for the reply.

You may understand what i want to achieve by looking at the fla. When you click on the blue button, i want the pink box to move. Right now it does move, but very quickly and not as one when we use a tween.

I could use the onclipevent and write two lines to increment the "x" value for the horizontal motion. or i could create a specific layer to tween the box.

But I was wondering if one could achieve the same effect using a for loop.

catreya
May 26th, 2003, 10:06 PM
i got the effect i needed. (phew!) am attaching the fla again. it was so simple, i cant believe it. took me just 3 mins to get it - that is once i got the hang of event handler stuff.

long way to go but i'll get there eventually.