It's worth noting that eventHandlers are functions. Essentially you'd want to use a function for any code that is deferred (eg. not run when you hit a frame on a timeline or when your document class is initialized) or any code that you want to run more than once.