Check other forum posts Bieber, there is a button class up in forums, if you create your button thru that class it is really easy to execute different stuff via your buttons. for button class post: http://twolivesleft.com/Codea/Talk/discussion/711/button-class#Item_22

But if you dont want to use a specific button class, it is simply under touched function just check coordinates and see if it is inside your buttons lower left-upper right. and execute stuff under that if.