Groups | Blog | Home
all groups > flash actionscript > october 2006 >

flash actionscript : addListener() vs. addEventListener()



DZ-015
10/25/2006 10:27:44 PM
I'm going through a set of tutorials, and where in the past I have used
addListener to specify an object as an event listener, a new tutorial is asking
me to use addEventListener().

The differrence is that addListener() requires only one parameter - the object
that will be the listener. addEventListener also requires a string which is
the name of the event that will be triggered. When I am listening for multiple
events, this would necessitate multiple listeners - a big pain.

So - here's my question. Is there any application where addListener() just
won't work, so I should deffinately use addEventListener()? Also, since
addEventListener() is both more limited in function and more code intensive, is
there any advantage it has over addListener()?

thanks!

DZ-015
10/26/2006 12:00:00 AM
ok - i see... but question... could I still use addListener() for components...?

kglad
10/26/2006 12:43:42 AM
kglad
10/26/2006 3:29:41 PM
well, the button component (and movieclips in general) cannot broadcast an event. so, the following wouldn't work:



AddThis Social Bookmark Button