View Full Version : Flash MX 2004 : Listeners vs Event Handlers ?
lse123
09-01-2006, 07:12 AM
I am beginner in Flash MX 2004 well:
What are the differences between Listeners and Event Handlers ?
firepages
09-02-2006, 02:35 AM
not a clue about flash
..but in general listeners `listen` for events ...say a mouse click (which is an event) ,and the Event Handler `handles` the event ... in other words tells the application to do whatever on click
Listeners are normally builtin to most objects and you rarely have to modify that code but events are usually added manually ...$pseudo-code
$but=new button(); //button() already has builtin listeners
$but->connect('on_click','functionname'); //on_click is one of them
there is no listener shown in this imaginary code since the button already has listeners builtin to understand clicks and mouseovers etc (as with javascript eventhandlers: onclick, onmouseover etc)
In some languages you can add listeners to existing objects, say to give an element that has no on_click listeners the ability to listen for clicks (and then add event handlers to that), others do not let you mess with listeners at all .. I do not know which of these flash is.
Listeners can also be something totally different (ala triggers) but I assume this is what is meant in flash
vBulletin® v3.8.2, Copyright ©2000-2010, Jelsoft Enterprises Ltd.