# Quaking motion

**URL:** https://forum.kirupa.com/t/quaking-motion/42120
**Category:** flash
**Created:** [February 5, 2004, 1:46pm UTC](https://forum.kirupa.com/t/quaking-motion/42120 "2004-02-05T13:46:29Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![hammml8](https://avatars.discourse-cdn.com/v4/letter/h/c68b51/32.png) [@hammml8](https://forum.kirupa.com/u/hammml8)
#### Post date: [February 5, 2004, 1:46pm UTC](https://forum.kirupa.com/t/quaking-motion/42120/1 "2004-02-05T13:46:29Z")

</div>

Is there a way to make an object or text quake using actionscript? I’m looking for a sort of earthquake feel to the movement.

Thanks a bunch!

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [February 5, 2004, 1:55pm UTC](https://forum.kirupa.com/t/quaking-motion/42120/2 "2004-02-05T13:55:57Z")

</div>

Try a simple random movement. Just make sure the movement occurs x times/sec and move the object just slightly.

I think.

If I have time I’ll work something out.

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [February 5, 2004, 7:02pm UTC](https://forum.kirupa.com/t/quaking-motion/42120/3 "2004-02-05T19:02:44Z")

</div>

Here’s a tutorial that makes things vibrate that may be what you’re looking for.  
[vibrate tutorial](http://www.kirupa.com/developer/mx/vibrate.htm)

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [February 6, 2004, 9:42pm UTC](https://forum.kirupa.com/t/quaking-motion/42120/4 "2004-02-06T21:42:29Z")

</div>

Oh man, that’s almost perfect! But is there a way to slow down the vibration speed a little?

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [February 6, 2004, 10:13pm UTC](https://forum.kirupa.com/t/quaking-motion/42120/5 "2004-02-06T22:13:42Z")

</div>

yes there is, the two easiest ways to do it in my opinion are:  
set a lower framerate or  
create a variable inside the script to slow it down like this(its the script from the kirupa tutorial)

onClipEvent (enterFrame) {  
waiting++  
if(waiting\>10){  
this.\_x = cx+(1+Math.random()\*5);  
this.\_y = cy+(1+Math.random()\*5);  
waiting=0  
}  
}
