# Creating a swaying blade of Grass in AS

**URL:** <https://forum.kirupa.com/t/creating-a-swaying-blade-of-grass-in-as/226679>\
**Category:** flash\
**Created:** [May 23, 2007, 3:15am UTC](https://forum.kirupa.com/t/creating-a-swaying-blade-of-grass-in-as/226679 "2007-05-23T03:15:51Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![lacohido](https://avatars.discourse-cdn.com/v4/letter/l/e8c25b/32.png) [@lacohido](https://forum.kirupa.com/u/lacohido)\
**Post date:** [May 23, 2007, 3:15am UTC](https://forum.kirupa.com/t/creating-a-swaying-blade-of-grass-in-as/226679/1 "2007-05-23T03:15:51Z")

</div>

Hey there all-  
Im trying to create a swaying piece of grass using the easing equation, but I think I’m getting it all wrong. Heres what I have, but it doesnt work at all:

[AS]  
blade.\_rotation=0;  
blade.onEnterFrame = function(){  
if(this.\_rotation \< 1){this.\_rotation +=(20 -this.\_rotation)/10;}  
else if (this.\_rotation \> 10){this.\_rotation +=(0 -this.\_rotation)/10;}  
}  
[/AS]

Is there an easy way of creating a swaying blade of grass. Thanks for the Help!!! :afro:
