Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Nov 2012
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Adobe LiveCycle setTimeOut

    I'm assuming this only happens in LiveCycle, but I am having issue with the setTimeOut and setInterval. Here is an example of the setTimeOut code
    Code:
     if (xfa.form.gameform.money_game.timer.rawValue === null){
     	xfa.host.messageBox("Input must be numeric.","Input", 3, 1);
     	}
     else {
     	var enemytime = app.setTimeOut("xfa.form.gameform.money_game.start_time.enemy();",1000);
     	}
     function enemy()
     {
     xfa.form.gameform.money_game.currentTime.execEvent("calculate");
     if (xfa.form.gameform.money_game.endTime.rawValue <= xfa.form.gameform.money_game.currentTime.rawValue){
    	app.clearTimeOut(xfa.form.gameform.money_game.start_time.enemytime);
     	xfa.host.messageBox("Done","Done", 3, 1);
     	}
     if (xfa.form.gameform.money_game.endTime.rawValue > xfa.form.gameform.money_game.currentTime.rawValue){
    	xfa.form.gameform.money_game.start_time.money();
     	xfa.form.gameform.money_game.currentTime.execEvent("calculate");
     	xfa.form.gameform.money_game.start_time.enemytime = app.setTimeOut("xfa.form.gameform.money_game.start_time.enemy();",1000);
     	}
     }
     function money()
     {
     	if (xfa.form.gameform.money_game.giveclicksnum.rawValue < 8){
     	xfa.form.gameform.money_game.money_total_op.rawValue = xfa.form.gameform.money_game.money_total_op.rawValue + 500;
    	}
     }
    If the number of seconds is small enough, the script functions properly. Otherwise it will randomly stop working at different times. Not sure if there is something that would stop the script from executing?

  • #2
    New to the CF scene
    Join Date
    Nov 2012
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I have found that if I open the Acrobat JavaScript debugger and run through each function, the program counts down as intented. If I close the debugger and run the program it still runs like it should. What could cause this to happen?


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •