Groups | Blog | Home
all groups > flash actionscript > december 2005 >

flash actionscript : addEventListener Equivalent for non-components?



Rich Hauck
12/22/2005 10:01:46 PM
Is there an alternative for the addEventListener component method for
MovieClips or class instances? Or, is there a way to add addEventListener as
a method of a class? I¹m trying to trigger an MVC Controller to make an
action based on the button calling it in the View, but I don¹t want to use a
LuigiL
12/23/2005 9:12:01 AM
That would greatly depend on your code and the MVC implementation. When using a
movieclip button you can just use the onRelease handler. Inside the onRelease
handler use a local var to get an instance of the controller and invoke a
method of the controller on that instance. Another solution is using
EventDispatcher or AsBroadcaster. Or use the Delegation Event Model...
AddThis Social Bookmark Button