December 2014
Beginner to intermediate
240 pages
6h 54m
English
To use a component property as a variable, we need to be able to get the current value and set a new value. This is done with blocks called, logically, getters and setters. They are available in the flyout menu for each component (see Figure 4.2).
Figure 4.2 The getter and setter blocks for TheButton’s Text property.
Here’s the idea: Every time the button is clicked, we will get the current value that’s in the text property, change it to be 1 greater, and then set that value back into the property. It will update the property to have the new number in it, which will appear on the screen.
That idea translates ...
Read now
Unlock full access