# Smooth motions

**URL:** <https://forum.kirupa.com/t/smooth-motions/21771>\
**Category:** Uncategorized\
**Created:** [May 26, 2003, 6:15am UTC](https://forum.kirupa.com/t/smooth-motions/21771 "2003-05-26T06:15:09Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![catreya](https://avatars.discourse-cdn.com/v4/letter/c/b38774/32.png) [@catreya](https://forum.kirupa.com/u/catreya)\
**Post date:** [May 26, 2003, 6:15am UTC](https://forum.kirupa.com/t/smooth-motions/21771/1 "2003-05-26T06:15:09Z")

</div>

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

---

<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:** [May 26, 2003, 4:34pm UTC](https://forum.kirupa.com/t/smooth-motions/21771/2 "2003-05-26T16:34:19Z")

</div>

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.

---

<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:** [May 26, 2003, 5:26pm UTC](https://forum.kirupa.com/t/smooth-motions/21771/3 "2003-05-26T17:26:18Z")

</div>

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.

---

<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:** [May 27, 2003, 2:06am UTC](https://forum.kirupa.com/t/smooth-motions/21771/4 "2003-05-27T02:06:11Z")

</div>

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.
