Skip to content
Advertisement

Attribute Error: List object has no attribute CheckClick

In the Swap function, I am checking under some index a button class instance, which I checked using print statements, but for some reason it still gives me an error saying that it has no such attribute check click. Any tips on formatting are also welcome, I am just a beginner. I am using three different arrays to hold various instances, values and coordinates for each corresponding array position. I am trying to make a sort of match 3 game. Thanks for any help

JavaScript

Advertisement

Answer

The mistake is in the Swap() function. Buffer is assigned to an item in the grid (BoardObjs[i][t]=Buffer). So Buffer needs to be a Button object instead of a row (list of objects):

Buffer = BoardObjs[i]

JavaScript

The initialization of the board can be simplified:

JavaScript
User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement