≡
Products
▼
Support
▼
Company
▼
Forum
Ambiera Forum
Discussions, Help and Support.
Create a new account
,
Search
, or Login:
Create reply in
CurrentNode's name from action
Posted by:
(you are not logged in)
Enter the missing letter in: "I?ternational"
(you are not logged in)
Text:
[quote][b][/b] wrote: yes you can use the below code to set the timer. [code]this.startTime = (new Date()).getTime(); //start the timer this.endTime = this.startTime + 1400; //1400 is the time duration (timer to end in)[/code] insert the above code into your script where you want to trigger the timer to get started. Generally in the key pressed events. then you need to add this bit of code into your "onAnimate" section in your behavior or by registering an onframevent using the command ccbRegisterOnFrameEvent(). [code] var now = (new Date()).getTime();//this the timer which compares the time stored in keyEvents function and then check it with the current time if (now > this.endTime) { //your code which you want to execute after the timer ends goes in here. };[/code] this will set the timer according to the time provided when the code is executed on keypresses. and then it compares it with the time going on each frame and then if the time on each frame is greater than the time stored when the key was pressed then it will execute the code provided. hope you understand it. *holy**holy*[/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