Go Back   CodingForums.com > :: Client side development > JavaScript programming > JavaScript frameworks

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 11-21-2012, 05:44 AM   PM User | #1
maraudir
New to the CF scene

 
Join Date: Nov 2012
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
maraudir is an unknown quantity at this point
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?
maraudir is offline   Reply With Quote
Old 11-21-2012, 06:47 AM   PM User | #2
maraudir
New to the CF scene

 
Join Date: Nov 2012
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
maraudir is an unknown quantity at this point
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?
maraudir is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 01:07 AM.


Advertisement
Log in to turn off these ads.