Change sprite based speed, etc?

I’m thinking about updating my game’s look by using sprite sheets. How can I change an object’s sprite based on how fast it is moving?

For example, if I make a sprite sheet with 3 images, how can I use image 1 if the speed = 0, image 2 if speed <= 10, and image 3 if speed > 10. It’s a physics based puzzler, so the object bounces around the level on its own.

Thanks,
Evan
[import]uid: 13529 topic_id: 7268 reply_id: 307268[/import]

monitor the object in an “enterFrame” event and change [lua].currentFrame[/lua] based on the speed. (speed will be a linearVelocity property if it’s physics-based, or otherwise you’ll need to check the difference between it’s current coords and it’s last coords)

[import]uid: 6645 topic_id: 7268 reply_id: 25608[/import]