image_mc.addEventListener(MouseEvent.CLICK, thumbclick); function thumbclick(evt:MouseEvent):void { currentPath = MouseEvent.target; trace(event.target); }
…I know u can use event.target.data in the UILoader, but what about here on mouseevents? Been trying diff. stuff… no luck. : (
function thumbclick(evt:MouseEvent):void { // evt.target refers to whatever was clicked to cause thumbclick to be called // so, if image_mc is the only thing that has an event listener calling thumbclick // then evt.target will refer to image_mc }
image_mc1.addEventListener(MouseEvent.CLICK, thumbclick); image_mc2.addEventListener(MouseEvent.CLICK, thumbclick);
function thumbclick(evt:MouseEvent):void { switch(evt.target.name){ case “image_mc1”: trace(“Image 1 clicked”); break; case “image_mc2”: trace(“image 2 clicked”); break; }
}
Creating engaging and entertaining content for designers and developers since 1998.
:: Copyright KIRUPA 2024 //--