≡
Products
▼
Support
▼
Company
▼
Forum
Ambiera Forum
Discussions, Help and Support.
Create a new account
,
Search
, or Login:
Create reply in
time counter
Posted by:
(you are not logged in)
Enter the missing letter in: "Inte?national"
(you are not logged in)
Text:
[quote][b]hadoken[/b] wrote: Meant as support for @coa and emerged at the same time when he had found a solution himself posting anyway an additional alternative also counting the CopperCube variable "time" by adjustable count rate in milliseconds plus you can set an initial value from where to start to count: [code]/* <behavior jsname="behavior_HadokenCCVarCount" description="behavior_HadokenCCVarCount"> <property name="CountRate_Ms" type="int" default="1000"> <property name="CC_var_time" type="string" default="10"> </behavior> */ behavior_HadokenCCVarCount = function() { this.init = 0; } behavior_HadokenCCVarCount.prototype.onAnimate = function() { ////////////////////// executing initially only once: if(this.init == 0) { this.time = Math.round(this.CC_var_time); ccbSetCopperCubeVariable("time", this.time); this.count = ccbGetCopperCubeVariable("time"); this.now = (new Date()).getTime(); this.endTime = this.now + this.CountRate_Ms; this.init = 1; } ////////////////////// this.now = (new Date()).getTime(); if(this.now > this.endTime) { this.count += 1; ccbSetCopperCubeVariable("time", this.count); this.endTime = this.now + this.CountRate_Ms; } // debug: print("CopperCube variable ' time ' = " + ccbGetCopperCubeVariable("time")); }[/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