Instance method Event Handlers

Given a class MyClass, how do I declare:

someObject:addEventListener(“tap”,MyClass:myMethod) ?

You either need a method with the event name:

MyClass:tap, MyClass:enterFrame, etc…

Or

You can use Closures, which at first seems to be pretty messy - but is definitely the most flexible approach.

This has been brought up on a number of occasions on these forums so try and do a search on the subject - or alternatively check out David McCuskey’s (Corona’s OOP genius) thorough explanation on the subject:

http://docs.davidmccuskey.com/display/docs/dmc_objects+Module+Details

You either need a method with the event name:

MyClass:tap, MyClass:enterFrame, etc…

Or

You can use Closures, which at first seems to be pretty messy - but is definitely the most flexible approach.

This has been brought up on a number of occasions on these forums so try and do a search on the subject - or alternatively check out David McCuskey’s (Corona’s OOP genius) thorough explanation on the subject:

http://docs.davidmccuskey.com/display/docs/dmc_objects+Module+Details