When the countdown is done (JS)

This counter is based on the same code and includes an example to trigger a custom named behavior. In the original example @jonathan added a comment into the code to signify the place where to trigger an action. If you don't want to code you can just trigger a custom behavior and then use it in Hype to open an url using the IDE.

var deltaTimeInterval = targetTimeInterval - currentTimeInterval;
if(deltaTimeInterval < 0) {
	// do something when the timer is expired (add the following line)
	hypeDocument.triggerCustomBehaviorNamed('timerExpired');
	// default is to just set it to 0
	deltaTimeInterval = 0;
}

Then wire it up:
image

There is also a mechanical clock version of @jonathan example.

2 Likes