PDA

View Full Version : event listener targeting wrong object??


natronp
07-24-2008, 02:20 PM
I've got a simple loop through xml and assign values to a clip from library scenario. my clip is called 't' and i assign it an eventListener for mouse click like this:

t.addEventListener(MouseEvent.CLICK, mcClick);


then later i define that function 'mcClick':

function mcClick(event:MouseEvent):void
{
trace("target: "+event.target.toolTip+" / "+event.target.url+" / "+event.target.action);
}

trying to trace out vars that i assigned in my initial xml loop and i get this error: ReferenceError: Error #1069: Property toolTip not found on flash.display.Loader and there is no default value.
at inAS3_fla::MainTimeline/mcClick() This error occurs regardless of which variable i try to trace out.

looks like my event is not actually targeting my attached clip huh? Where have i gone wrong?

senocular
07-24-2008, 02:26 PM
its likely you want currentTarget rather than target.

natronp
07-24-2008, 03:20 PM
cool! thank you.. new to AS 3.