# Tricky random interval question

**URL:** <https://forum.kirupa.com/t/tricky-random-interval-question/236744>\
**Category:** Uncategorized\
**Created:** [August 23, 2007, 10:44am UTC](https://forum.kirupa.com/t/tricky-random-interval-question/236744 "2007-08-23T10:44:29Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![wlw](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/wlw/32/3745_2.png) [@wlw](https://forum.kirupa.com/u/wlw)\
**Post date:** [August 23, 2007, 10:44am UTC](https://forum.kirupa.com/t/tricky-random-interval-question/236744/1 "2007-08-23T10:44:29Z")

</div>

Hey guys/girls,

I have a problem that I cant seem to figure out how to get this to work. I’ve scoured the internet and tried piecing together tutorials and I cant figure this out.

Ok, I’m trying to get the word “woosh!” to appear when one moves their mouse. This is my code.

var i = 0;  
\_root.onMouseMove = function() {  
var t = \_root.attachMovie(“woosh”, “woosh”+i++,getNextHighestDepth());  
t.\_x = \_xmouse;  
t.\_y = \_ymouse;  
t.\_xscale = t.\_yscale = Math.random()\*150 +20;  
}

So that works. But I dont want it to constantly keep re-appearing every milla-second. I want it to happen once every so often. (preferably when you move the mouse fast or hard.) Is this possible? I tried using setInterval but I couldn’t get that to work.

also, after a short while, the animation starts to get choppy. I’m not sure what that is.  
Can someone help me solve my problem(s)?

Thanks in advance,  
-w|w
