Random Jumping and then play next frame

Hello guys,

I’ve watched this Random Jumping video tutorial 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:


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!