The “entering numbers in a text field” is just one of many ways to increase the bar. You can do it onclick or use your own function. This is just to show you a way of achieving what you want. I don’t really have the time to write a specific script for your specific needs. If you supply a document showing what you’ve done then people will try and help you.
You asked for
I told you and gave you an example
Again I showed you how to do this.
Instead of an input area you can change it to a button or like I said a specific function. So, in your example of a pinball game. When your function for the action of hitting an element is called you can include the method above so that a bar will increase by a specific amount and the text will reflect that.
Or you could even go to a time in a timeline to achieve a similar effect like @h_classen said. Just have a symbol that represents the bar and play an animation when an element is hit.