I have the following function:
function textnumber(event:MouseEvent):void {
//if any phone number fields are not filled
if (area_code.length != 3 || phone_3.length != 3 || phone_4.length!= 4){
tb_number.addChild(bad_number);
}
//if phone number fields are correct
else{
tb_number.removeChild(bad_number);
}
}
The child is ADDED fine, but when the phone number fields are correct and the function executes, it should remove the “bad_number” child. It doesn’t though, I’m wondering how within that function I can target the bad_number child to get rid of it?