vidachristy
Feb 27th 2006, 9:56 am
I have a customer requirement to write a timer into an application so that they can time how long an action takes place. So...
I am trying to get this getTimer() setInterval() thing to write to a textfield in a flash form.(MX7)
Please review the code below and see if you can see a stupid mistake i am making....I am so close and yet, so far away...
if a write an alert in the updateTimer function, the alert will show, but it still will not display the variable "elapsedTime" even in the alert....
Could this be a scope issue?
Attach Code
//the actionscript is in a <cfformitem type=script>
function startTimer() {
alert ("in Start Timer");
myInterval = setInterval(updateTimer, 1000);
timerStatus = "TICKING";
};
function updateTimer() {
elapsedTime = getTimer();
stwa.text= elapsedTime;
};
<cfinput type="text" label="Timed Duration" name="stwa" width="100" >
<cfinput type="button" label="Start" name="theButton" onClick="startTimer()" value="Start" >
form fields:
I am trying to get this getTimer() setInterval() thing to write to a textfield in a flash form.(MX7)
Please review the code below and see if you can see a stupid mistake i am making....I am so close and yet, so far away...
if a write an alert in the updateTimer function, the alert will show, but it still will not display the variable "elapsedTime" even in the alert....
Could this be a scope issue?
Attach Code
//the actionscript is in a <cfformitem type=script>
function startTimer() {
alert ("in Start Timer");
myInterval = setInterval(updateTimer, 1000);
timerStatus = "TICKING";
};
function updateTimer() {
elapsedTime = getTimer();
stwa.text= elapsedTime;
};
<cfinput type="text" label="Timed Duration" name="stwa" width="100" >
<cfinput type="button" label="Start" name="theButton" onClick="startTimer()" value="Start" >
form fields: