View Single Post
Old 11-25-2019, 07:45 AM   #10
Human being with feelings
Lokasenna's Avatar
Join Date: Sep 2008
Location: Calgary, AB, Canada
Posts: 6,551

Ah, I see the issue.

Lua doesn't hoist variables, even global ones, so you can't assign func = startButton before you've declared startButton. In some cases where it's necessary, you can just declare local myThing without a value early on and assign a function to it somewhere later; anything else declared after myThing will be able to see it and access it.

In this case, the script fails silently because the Button class adds a do-nothing function to keep itself from crashing.

1. Take all of your function declarations (startButton, resetWindow, etc) and move them above where all of the elements are declared.
2. For buttons where your onmouseup is just calling a function, delete the onmouseup code and pass the function to the button directly with func = startButton.

Should work now. If it doesn't, I've got it working here and can PM you the code.
Lokasenna is offline   Reply With Quote