Quantcast
Channel: Adobe Community : Popular Discussions - LiveCycle Designer
Viewing all articles
Browse latest Browse all 16286

app.setInterval issues

$
0
0

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.


Viewing all articles
Browse latest Browse all 16286

Trending Articles