Using list data to update UI Elements?


I want the data entered into the text input field to populate a list and show in the labels text. The user can update the info and stats for the hero.

I tired to use an iterating counter to keep track of all indexes of my lists. However I can't 'set' a label's text value from within a list. I can only call it.

What would you do? Some of my students built really long If/then statements to work through the iterations and stop at 8.

Check out this sample, which generalizes the problem:

This introduces dictionaries, which use names instead of numbers to access items in a collection.

The students' stat names are equivalent to the contact attribute names in my sample.

The secret to that is to keep a list of the Label component blocks, not the Label.Text blocks., and to use the Generic (Any) blocks to updated the selected Label component.

(The component block is always the last block in the component's Blocks pallette.)

Here are some sample apps that use lists of components: