Top | Previous | Next |
Timer |
Description The timer button is an invisible button that can be used to create repeated events in a window. This is often used for animations or repetitive scripts within a window. When running, the timer's Value property is incremented by the Step By value, until the value tis the Bound, at which point it repeats. It is often useful to bind other values to a timer's Value property.
For instance, if you set the timer's Bound property to 360, and bind an object's rotation to the Value property, the object will spin in a circle when the timer is running.
Or, suppose that you have images that make up frames of animation. Name your images: "Frame0.png", "Frame1.png", "Frame2.png". Set the timer's Bound to be 3, Then bind the image path of an image component to the following expression: "Frame" + {Root Container.Timer.value} + ".png"
How fast the timer counts is up to the Delay property, which is the time between counts in milliseconds.
Want to run a script every time the timer counts? First, make sure you don't actually want to write a project Timer Script, which will run on some interval whenever the application is running. In contrast, a script that works via a Timer component will only run while the window that contains the Timer is open, and the Timer is running. The way to do this is to attach an event script to the actionPerformed event. Properties
Scripting Events The following event sets are fired by this component. See Component Event Handlers to learn more.
Scripting Functions This component has no special scripting functions. |