≡
Products
▼
Support
▼
Company
▼
Forum
Ambiera Forum
Discussions, Help and Support.
Create a new account
,
Search
, or Login:
Create reply in
wait javascript
Posted by:
(you are not logged in)
Enter the missing letter in: "Internationa?"
(you are not logged in)
Text:
[quote][b]hadoken[/b] wrote: @just_in_case thanks for the timer programming help at [url]https://ambiera.com/forum.php?t=9019[/url] with javascript execution after a "When a key is pressed" behavior I can report success with: [code] print("START"); var startTime = (new Date()).getTime(); var endTime = this.startTime + 1500; function onFrameDrawing() { var now = (new Date()).getTime(); print(now); if (now > endTime) { print("TIME UP!"); } } ccbRegisterOnFrameEvent(onFrameDrawing); [/code] After putting the code example into an action it failed. I know there is already the official "action_DoLater.js" But I want to learn how to get this done from scratch. In the DoLater action the regular update of the timer is solved in a kind of nested way with more advanced function registering which I don't understand at the moment. How could my attempt be corrected to make it also work as action? : [code] <action jsname="action_DoAfterWait" description="action_DoAfterWait"> </action> */ action_DoAfterWait = function() { } action_DoAfterWait.prototype.execute = function(currentNode) { print("START"); var startTime = (new Date()).getTime(); var endTime = this.startTime + 1500; function onFrameDrawing() { var now = (new Date()).getTime(); print(now); if (now > endTime) { print("TIME UP!"); } } ccbRegisterOnFrameEvent(onFrameDrawing); }[/code][/quote]
Possible Codes
Feature
Code
Link
[url] www.example.com [/url]
Bold
[b]bold text[/b]
Image
[img]http://www.example.com/image.jpg[/img]
Quote
[quote]quoted text[/quote]
Code
[code]source code[/code]
Emoticons
Copyright© Ambiera e.U. all rights reserved.
Privacy Policy | Terms and Conditions | Imprint | Contact