Hi
I am trying to call a function from a timer using the following code:
var mTimer;
function testTimer()
{
mTimer = app.setInterval( "runTimer()", 1000 );
}
function runTimer()
{
app.clearInterval(mTimer);
app.alert("timer run");
}
The function runTimer() simply doesn't run.
The only way I can get the timer to work is with a line like this:
mTimer = app.setInterval( "app.alert('test')", 1000 );
However, calling a function doesn't work. The code is in a global module. It doesn't work with anything I try, such as:
mTimer = app.setInterval( "Global.runTimer()", 1000 );
I am using a Dynamic XML form in Designer 9 (trial version).
Many thanks
Geoff Olding
Solved! Go to Solution.
This is not going to be easy to explain but you are mixing object models. The command app.asetInterval is an Acrobat command based on the AcroForm Model. The Global.runTimer() function is an function written against the xfa model. Acroform objects donot know about XFA objects so your synatx wil be incorrect. To be able to call that function you will need the associated Acroform name. Here is a sample to show you The code is on the click event of the button.
Paul
This is not going to be easy to explain but you are mixing object models. The command app.asetInterval is an Acrobat command based on the AcroForm Model. The Global.runTimer() function is an function written against the xfa model. Acroform objects donot know about XFA objects so your synatx wil be incorrect. To be able to call that function you will need the associated Acroform name. Here is a sample to show you The code is on the click event of the button.
Paul
Many thanks
Now working
Views
Replies
Total Likes
You are geniues man hhhhh You helped me as will but I have one problem which the running timer will stop after 10 seconds why is that ?
Views
Replies
Total Likes
Views
Likes
Replies