Access a Button or Label as a variable


I would like to change the text of a one or another Button (or a label) according to a variable.
I don't want to use an IF statement.

Is there a way to address a Button/Label this way ?
instead of this :
I would like to enter something like this :

so that "device" points to "Button4"

Is it possible ?


You can use the "Any Button" blocks.

In the Blocks drawer, click on the + sign near Any Components, and you should see Any Button. Click on Any Button and find the "set Button. Text" block. Then, use this:

1 Like

Search this board for "Wordle in a Day" for a sample app.

1 Like

Hi Gordon_Lu, just 4 words : "it works so well !"
Many thanks, your answer is great, I had no idea what ANY COMPONENT would stand for. Now, I know.

AGB : "Wordle in a day" is a great way to learn a lot of concepts, thanks for sharing !

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.