# Random Jumping and then play next frame

**URL:** <https://forum.kirupa.com/t/random-jumping-and-then-play-next-frame/234771>\
**Category:** flash\
**Created:** [August 6, 2007, 2:04am UTC](https://forum.kirupa.com/t/random-jumping-and-then-play-next-frame/234771 "2007-08-06T02:04:00Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![4lex](https://avatars.discourse-cdn.com/v4/letter/4/c68b51/32.png) [@4lex](https://forum.kirupa.com/u/4lex)\
**Post date:** [August 6, 2007, 2:04am UTC](https://forum.kirupa.com/t/random-jumping-and-then-play-next-frame/234771/1 "2007-08-06T02:04:00Z")

</div>

Hello guys,

I’ve watched this [Random Jumping video tutorial](http://www.kirupa.com/developer/flash8/video/randomJumping.htm) and it’s a very easy to understand tutorial, I loved it.

I was wondering if I can make it go to the next frame and play when the user rolls over or click the animation, after a short amount of time, like 5 seconds. I’m guessing a setInterval function; I did some research and tried some examples, but couldn’t achieve the desired effect.

Here is the code:

```auto

on (rollOver) {
    function randRange(min:Number, max:Number):Number {
        var randomNum:Number = Math.floor(Math.random()*(max-min+1))+min;
        return randomNum;
    }
    _x = randRange(50, 170);
    _y = randRange(50, 170);
}

```

Is it possible?

Thanks!
