I have some in-file actionscript 3.0 code. This code controls a number of elements on it's stage. These elements each have an Over, an Out, and a Click event.
I currently define these event listeners as so:
mc_hotspot.addEventListener(MouseEvent.MOUSE_OVER, lift);
mc_hotspot.addEventListener(MouseEvent.MOUSE_OUT, setDown);
mc_hotspot.addEventListener(MouseEvent.CLICK, select);;
mc_spinspot.addEventListener(MouseEvent.MOUSE_OVER, spinspotOver);
mc_spinspot.addEventListener(MouseEvent.MOUSE_OUT, spinspotOut);
mc_spinspot.addEventListener(MouseEvent.CLICK, spinClick);
mc_spinspot2.addEventListener(MouseEvent.MOUSE_OVER, spinspot2Over);
mc_spinspot2.addEventListener(MouseEvent.MOUSE_OUT, spinspot2Out);
mc_spinspot2.addEventListener(MouseEvent.CLICK, spin2Click);
btn_back.addEventListener(MouseEvent.MOUSE_OVER, backOver);
btn_back.addEventListener(MouseEvent.MOUSE_OUT, backOut);
btn_back.addEventListener(MouseEvent.CLICK, backClick);
As you can see, this is a very long and convoluted way of defining the events for these elements and there is also an event triggered function to go with each of these.
I'll be expanding the project to add three more spinspots and one or two more buttons soon and I was just wondering if there was any other way to define and cater for these events.
In the case of the spinspots all the over and out events are the same but each have their own duplicate function and listener.
Thanks in advance