# Getting objects to rotate back and forth

**URL:** <https://forum.kirupa.com/t/getting-objects-to-rotate-back-and-forth/246102>\
**Category:** flash\
**Created:** [December 7, 2007, 1:03am UTC](https://forum.kirupa.com/t/getting-objects-to-rotate-back-and-forth/246102 "2007-12-07T01:03:04Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![kenyabob](https://avatars.discourse-cdn.com/v4/letter/k/5f9b8f/32.png) [@kenyabob](https://forum.kirupa.com/u/kenyabob)\
**Post date:** [December 7, 2007, 1:03am UTC](https://forum.kirupa.com/t/getting-objects-to-rotate-back-and-forth/246102/1 "2007-12-07T01:03:04Z")

</div>

I have an animation with leaves falling in front of the screen. I need the leaves to rock back and forth as they descend. Let’s say rocking backing and forth 20 to 40 degrees each way. I realize that this would be accomplished with \_rotation and then saying something along the lines of if less than twenty but greater than 0… with some kind of switch when it either 20 or -20 to reverse the direction, but I am unsure how these pieces come together. Any help would be great.

Thanks guys in advance.
