Just add the same listener to all the objects :)
This is the example you are proposing.
l = new EventListener() -> a parameter is not needed here
a.addEventListener(l)
b.addEventListener(l)
c.addEventListener(l)
The parameter in the eventListener constructor is not needed. You can use it
to pass a parameter to the listenr that later can be retrieved using :
getTarget() method of the event parameter , that is the 'e' in the function.
Joshua Hancik wrote:
> My peers:
>
> Is there a method of alieviating the terrible redundancy in the
> example below? That is, is there a way to attach the same eventListener
> to several layers at once?
>
> industryListener=new EventListener(industry)
> industryListener.onslideend=function(e) {
> ani = 0
> }
>
> casesListener=new EventListener(cases)
> casesListener.onslideend=function(e) {
> ani = 0
> }
>
> listingListener=new EventListener(listing)
> listingListener.onslideend=function(e) {
> ani = 0
> }
>
> industry.addEventListener(industryListener)
> cases.addEventListener(casesListener)
> listing.addEventListener(listingListener)
>
> --
> Joshua Hancik
> VP Interactive Media
> The Factory Interactive, Inc.
> 305.752.9400
_______________________________________________
Dynapi-Help mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/mailman/listinfo/dynapi-help