If you use one eventlistener for more objects, you would typically do this:
var testListener = new EventListener()
testListener.onmouseout = function(e) {
var o = e.getSource()
window.status='the mouse is outside '+o
}
testLayer1.addEventListener(testListener)
testLayer2.addEventListener(testListener)
testLayer3.addEventListener(testListener)
testLayer4.addEventListener(testListener)
getTarget returns undefined, as you can't pass all four values, getSource
returns correctly.
Cheers,
Richard Bennett
[EMAIL PROTECTED]
www.richardinfo.com
(Everything running on, and ported to the 19/12/2000 snapshot of DynAPI2)
----- Original Message -----
From: "Daniel Aborg" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, February 12, 2001 12:23 PM
Subject: [Dynapi-Help] EventListener source/target
> Hi!
>
> When setting up an EventListener, is there any practical difference
> between using getSource() and getTarget() in the event functions? (Given
> of course that the EventListener's source and target are the same.) In
> other words, will the source ever be something else than the object you
> add the EventListener to?
>
> Thanks!
>
> /D
>
> --
> Daniel Aborg <[EMAIL PROTECTED]> +44-(0)7765-961155
>
> _______________________________________________
> Dynapi-Help mailing list
> [EMAIL PROTECTED]
> http://lists.sourceforge.net/lists/listinfo/dynapi-help
> ____________________________________________________________
> Get your free domain name and domain-based e-mail from
> Namezero.com. New! Namezero Plus domains now available.
> Find out more at: http://www.namezero.com
>
_______________________________________________
Dynapi-Help mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/dynapi-help