# Check if shake

**URL:** <https://forum.kirupa.com/t/check-if-shake/264121>\
**Category:** flash\
**Created:** [June 23, 2008, 12:36pm UTC](https://forum.kirupa.com/t/check-if-shake/264121 "2008-06-23T12:36:17Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![andreas85](https://avatars.discourse-cdn.com/v4/letter/a/bc79bd/32.png) [@andreas85](https://forum.kirupa.com/u/andreas85)\
**Post date:** [June 23, 2008, 12:36pm UTC](https://forum.kirupa.com/t/check-if-shake/264121/1 "2008-06-23T12:36:17Z")

</div>

Hi!

I’m new to this forum and kinda new to actionscript.

I’m trying to make a site, where you can move various movieclips around, and for that I use a simple drag function with easing, shown below…

\_root.myMC.ease = 2;  
\_root.myMC.onPress = function() {  
this.drag = true;  
};  
\_root.myMC.onEnterFrame = function() {  
if (this.drag == true) {  
this.targX = \_root.\_xmouse;  
this.targY = \_root.\_ymouse;  
}  
if (this.\_x != this.targX | this.\_y != this.targY) {  
this.\_x += (this.targX-this.\_x)/this.ease;  
this.\_y += (this.targY-this.\_y)/this.ease;  
}  
};  
\_root.myMC.onMouseUp = function() {  
this.drag = false;  
};

When moving the movieclip around, my idea is to have something happen to it, if the user shakes the movieclip. But I don’t know how to check is the movieclip is shaking, does anyone have an idea as to how I’ll do this?

Thanks
