Made up class events

This maybe stupid…but could I make up my own events for cl***** I write?

Like the XML object has the onLoad…could I make one for an object I made up?