# How do i stop the earth quake!

**URL:** <https://forum.kirupa.com/t/how-do-i-stop-the-earth-quake/210422>\
**Category:** Uncategorized\
**Created:** [December 18, 2006, 6:42pm UTC](https://forum.kirupa.com/t/how-do-i-stop-the-earth-quake/210422 "2006-12-18T18:42:57Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![p\_ziity](https://avatars.discourse-cdn.com/v4/letter/p/a9a28c/32.png) [@p\_ziity](https://forum.kirupa.com/u/p_ziity)\
**Post date:** [December 18, 2006, 6:42pm UTC](https://forum.kirupa.com/t/how-do-i-stop-the-earth-quake/210422/1 "2006-12-18T18:42:57Z")

</div>

So here is a link to a site I am designing [http://www.d-decks.com/new\_interface3.html](http://www.d-decks.com/new_interface3.html)  
You will see on the home page I made a scrooling lanscape and when it gets to the end it does an earthquake shake that is making people nauseous and vomit.  
cool zelda!🔗

here is my script.

\_root.homes.onMouseMove = function() {  
constrainedMove(homes, 4, 1);  
};  
function constrainedMove(target:MovieClip, speed:Number, dir:Number) {  
var mousePercent:Number = \_xmouse/Stage.width;  
var mSpeed:Number;  
if (dir == 2) {  
mSpeed = 1-mousePercent;  
} else {  
mSpeed = mousePercent;  
}  
target.destX = Math.round(-((target.\_width-Stage.width)_mSpeed));  
target.onEnterFrame = function() {  
if (target.\_x == target.destX) {  
delete target.onEnterFrame;  
} else if (target.\_x\>target.destX) {  
target.\_x -= Math.ceil((target.\_x-target.destX)_(speed/100));  
} else if (target.\_x\<target.destX) {  
target.\_x += Math.ceil((target.destX-target.\_x)\*(speed/100));  
}  
};  
}
