It works fine for me without any errors. Something in your code appears to be calling one of the functions before the synonym is set. When does this occur? Does it occur every time? Any other info would be helpful.

I would start a empty test level with only a position for the view, add this code and make sure it works on your system. It should work OK but if it does not then something is wrong with your setup. If it works OK, start by assigning the ON_1 and ON_2 functions to simple panel buttons. Continue adding your other code until an error occurs. Then you will know where the problem starts.