Event.currentTarget.visible = false back to true
Hi, I've got a tricky issue, I' m making a game involving learning activities. In this one, I've got to push letters on a screen and compose a word. Each time you click on a letter it sets its state to false, so you can't click it again. Everything as worked so far, but right now I don't know how to set back to visible the letters I clicked on.
Basically I've to do this, for instance, if you make a mistake selecting the letters you want for composing the word. I managed to create a delete button you can press, so the letter will be pop out from the textField, but how can I set the button/letter back to visible ?
I tried to push the clickedLetters into an Array, but then they become Strings so visible = true won't work. Any help ?
Thanks
private function takeTheLetter(Event:MouseEvent):void
{
var letterTraced:String = Event.currentTarget.letter.text.charAt(0);
clickedLettersArray.push(letterTraced);
//show the letters that are typed;
var composeWord:String = clickedLettersArray.toString();
composeWord = composeWord.split(",").join("");
hero_txt.text = composeWord;
//remove the pressed letter
Event.currentTarget.visible = false;
currentTargetArray.push(letterTraced);
trace(currentTargetArray);
}
private function deleteTheLetter(Event:MouseEvent):void
{
clickedLettersArray.pop();
//set the array back to a string;
var correctedWord:String = clickedLettersArray.join(",");
//set the true sprite to compare
correctedWord = correctedWord.split(",").join("");
hero_txt.text = correctedWord;
}