View Single Post
Old 11-17-2012, 02:07 PM   PM User | #2
Philip M
Supreme Master coder!

 
Philip M's Avatar
 
Join Date: Jun 2002
Location: London, England
Posts: 17,044
Thanks: 197
Thanked 2,412 Times in 2,390 Posts
Philip M has a spectacular aura aboutPhilip M has a spectacular aura aboutPhilip M has a spectacular aura about
You should avoid giving names or id's to your variables/functions/arguments/forms words which are HTML/JavaScript methods/properties/attributes such as 'name' or 'id' or 'value' or 'test' or 'text' or 'checked' or 'click' or 'href' or 'closed' or 'go' or 'submit' or 'replace' or 'button' or 'radio' or 'parseInt'. Or 'timeout'.

I don't use Adobe but this works just fine in vanilla Javascript:-

Code:
<script type = "text/javascript">

function TimedOut() {
alert ("The time has elapsed");
}

//prompt for number of seconds

var secondCount = Number(window.prompt("Enter number of seconds", "Number of Seconds")) || 0;  // trap NaN entries
//start counter
if (secondCount >= 0) {
//timer set for thousandths of a second
window.setTimeout(TimedOut, 1000*secondCount);
}

</script>
__________________

All the code given in this post has been tested and is intended to address the question asked.
Unless stated otherwise it is not just a demonstration.
Philip M is offline   Reply With Quote