Loops in flash (slowing them down)

Can anyone tell me how I would go about slowing down a loop in flash mx.

I was trying to achieve a simple effect where the user clicks a button a object moves slowly across the page until it reaches a destination I set.

I sort of got it to work by using a loop and changing the x position through that. The problem is that flash wizzes through the loop so it appears that the object just jumps from one position to the final position.

Is there anyway to slow down a loop or some method of telling flash to wait for a set amount of time.

Thanks.

loops are processed in one frame. For operations over time, you would perform then in an onClipEvent(enterFrame) or onEnterFrame event.

Thanks for the help.

I had a look around and from what I can tell if I didnt want to use the ‘onClipEvent(enterFrame)’ method then the alternative would be to use the setinterval command.

I had a look at that command and couldn’t figure it out at all. I’m amazed that someone has not created a function that will enable you to move a movie clip anywhere on the stage and also specify the speed at which you want it to move. This would be SO useful.

Any actionscript wizards out there?

Steady motion (Just put it in an enterFrame):

http://www.flash-france.com/actionscript.php?action=ViewProto&Protoid=69

If you want easing, there’s a tute here.

pom :slight_smile:

*Originally posted by Ilyas *
**Steady motion (Just put it in an enterFrame):

If you want easing, there’s a tute here.

pom :slight_smile: **

Thanks for the help, i’ll take a look.