Expand my Community achievements bar.

app.setInterval issues

Avatar

Former Community Member

I have added the code:

 

gameform.money_game.start_time::click - (JavaScript, client)

function TimedOut() {

app.alert ("The time has elapsed");

// cancel the timer:

app.clearInterval(timerout);

}

// Prompt for number of seconds

var secondCount = app.response("Enter number of seconds", "Number of Seconds", "", "")

// Start counter

if (secondCount >= 0)

// Timer set for thousandths of a second

var timerout = app.setInterval("TimedOut();",1000*secondCount);

It will properly ask for the amount of time and the secondCount variable is stored properly, but I never end up with an app.alert telling me I'm finished.  What is wrong with that code?

Edit: I found one of my issues.  It was related to the absolute path for the function as shown here:

var timerout = app.setInterval("xfa.form.gameform.money_game.start_time.TimedOut()", 1000*secondCount);

I never managed to get the setInterval to work but I was able to get setTimeOut to for for 8 seconds or less.

0 Replies