So. I have a list of nine variables, all set to 'True'. I also have nine imagebuttons. When one of these imagebuttons is pressed, I'd like it to change the corresponding variable in the list to 'False.'
Logically, it seems like the best action to use would be 'ToggleField', but when I try this:
Code: Select all
for i in range(9):
if selected[i]:
imagebutton idle "backsm.png" hover "backsm2.png" action [ToggleField(selected, "selected[i]"), SetVariable("cards_picked", (cards_picked+1))] xalign xx ypos 0.3
else:
add "backsm.png" xalign xx ypos 0.4
Code: Select all
AttributeError: 'RevertableList' object has no attribute 'selected[i]'
Help! Should I be using a different action? Is my syntax wrong? Am I going about this entirely in the wrong way?