A handler is essentially a programming routine. It “handles” a task, basically. It has a starting clause and a ending clause, like:
on MouseUp put "Hello world!" end MouseUp
Variables and many settings are resetted outside the handler, so it's easy to avoid mistakes. For example:
on handler1 put 5 into temp answer temp #this returns "5" end handler1 on handler2 answer temp #this return "temp", because temp has no value end handler2
If you need to keep a variable between handlers use Custom properties.