The button constants for ABXY are simply #A, #B, #X and #Y. To change a sprite you can just use SPSET again with a different definition number. Animations are a bit hard to make, but if you're willing you can look up SPANIM and the "Anim." tool in the SmileTool.