I have a function that is called on a keydown event. Inside the function I do this:
function keyDownHandler(event : KeyboardEvent) : void
{
if(cursorMoveCnt < 5 && event.keyCode != Keyboard.ENTER)
{
trace(i);
trace(cursorMoveCnt);
stage.focus = arrayOfBoxes[i+cursorMoveCnt];
cursorMoveCnt++;
}
I want to call the same function after every 20 seconds even if enter key is not pressed by the User. Can I create the same effect as pressing the Enter key through code in some way so that the code within the if condition inside the function gets executed?