You'll actually need to capture screenshot of the window quick enough so you can check for circle or whatever thing you are trying to match. However this method requires quite good amount of efficiency, which I doubt you can get. A good and more practical method would be to use cheat engine for tracking the object's location and getting button's handle so you can do this efficiently. There are many tutorials on how to hack flash games using cheat engine. Go, have a look at them.