Hello guys. Can I change an event target’s name? or it’s an only-read property? I’ve been googling it but to no avail…
For example, say this is my button code:
buttonOne.addEventListener(MouseEvent.CLICK,showImageOne,false,0,true);
//variable to store he last button clicked
var prevClicked:*;
function showImageOne(event:MouseEvent):void
{
if(event.target.name !=prevClick)
{
prevClick=event.target.name;
thecontainer.gotoAndPlay(“begin”);
}
}
if trace the event target’s name, you get buttonOne. But what I need to do is have the event’s target’s name to become buttonOne1. Why ? because I already have a button with the instance name. That’s my setup, not the way I would do it OF COURSE, but this is the way the unique file is setup for my aunt, to have two set of buttons that calls the same image…(not the thumbnail issue I had before)…
so the Question: is there a way to add a letter or remove a letter from the event target’s name? You know how you can add a letter to the beginning of an array like buttonsArray.unshift(newButton)…can you do the same thing with an event.target.name ?
thanks for any help; I’m still learning this
x lisa x