≡
Products
▼
Support
▼
Company
▼
Forum
Ambiera Forum
Discussions, Help and Support.
Create a new account
,
Search
, or Login:
Create reply in
New extension - variable time delay
Posted by:
(you are not logged in)
Enter the missing letter in: "Internat?onal"
(you are not logged in)
Text:
[quote][b]Robo[/b] wrote: I edited the doLater extension to allow for any amount of time delay to be run as needed based off coppercube variable ('delay'). Its helped tidy up my javascript into neat sections this way. // This is a scripted coppercube action. // It does an action after variable 'delay' received /* <action jsname="action_DoLaterVar" description="Do later with variable delay"> <property name="ActionToDo" type="action" /> </action> */ action_DoLaterVar = function(){}; action_DoLaterVar.prototype.execute = function(currentNode) { var me = this; var wait = ccbGetCopperCubeVariable("delay"); this.registeredFunction = function() { me.variableWait(); }; ccbRegisterOnFrameEvent(me.registeredFunction); this.startTime = (new Date()).getTime(); this.endTime = this.startTime-(-wait); this.currentNode = currentNode; } action_DoLaterVar.prototype.variableWait = function() { var now = (new Date()).getTime(); if (now > this.endTime) { ccbInvokeAction(this.ActionToDo, this.currentNode); ccbUnregisterOnFrameEvent(this.registeredFunction); } }[/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