Skip to main content

Timer (타이머) Widget Control

This page lists the Widget Control members (Property · Method · Event) you use to control the Timer widget from a script. To learn about the widget itself and how to use it, visit Timer.

info

In the examples below, timerID is the name (ID) you assigned to the Timer widget on the canvas. In a script, access members as widgetID.member.

Widget Control summary

Widget ControlKindSignatureDescription
startMethodstart()Starts the timer from its start value
stopMethodstop()Stops the timer, keeping the displayed value
resetMethodreset()Stops the timer and returns it to the start value
isRunningMethodisRunning(): booleanReturns true while the timer is running
onExpiredEventonExpired = () => { ... }Runs when the countdown reaches 00:00

Property

info

Not applicable — the Timer widget has no script-only Property. From a script, read and write values with the common Widget Control (getProperty / setProperty) below.

Method

start

Starts the timer from its start value. Countdown mode starts from the time you configured, and count-up mode starts from 0. Call it again while the timer is running and it resets first, then starts over. It does nothing in edit (design) mode.

  • Kind: Method
  • Parameters: None
  • Returns: None

Example

timerID.start();

stop

Stops the timer. The currently displayed value stays as it is.

  • Kind: Method
  • Parameters: None
  • Returns: None

Example

timerID.stop();

reset

Stops the timer and returns the displayed value to the start value. Countdown mode returns to the time you configured, and count-up mode returns to 0.

  • Kind: Method
  • Parameters: None
  • Returns: None

Example

timerID.reset();

isRunning

Returns whether the timer is running.

  • Kind: Method
  • Parameters: None
  • Returns: boolean - true while running, false when stopped

Example

const running = timerID.isRunning();

Event

onExpired

Runs when a countdown timer reaches 00:00. Assign a callback function for the behavior you want. It never fires in count-up mode.

  • Kind: Event
  • Handler: a callback function that takes no arguments
  • Returns: None

Example

timerID.onExpired = () => {
// Code to run when the timer expires
};

Common Widget Control (all widgets)

note

Every widget can use name-based common Widget Control (Method) members such as setProperty, getProperty, and setStyleProperty. See the common reference doc (to be written).