Check if shake

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