How to add an element to an array, then be able to remove it specifically
So i have a list of numbers. The user is able to then add numbers to that list. I have a button which allows the user to remove any number of their choice by typing that number in a textbox. For some reason the numbers that the user add to the list will not dissapear when chosen whereas the original numbers go away no problem.
The name of the array itself is mesEntiers and the name of the texbox is : IntegersIn_txt
Here is the code :
function supprimer(event:MouseEvent):void
{
var indiceChiffre:int;
indiceChiffre =(mesEntiers.indexOf(IntegersIn_txt.text));
// La méthode indexOf renvoie l'indice d'un élément ou -1 si non trouvé.
trace("testBtn")
if (indiceChiffre != -1)
{
for (var i=indiceChiffre; i <mesEntiers.length; i++)
{
mesEntiers = mesEntiers[i+1];
trace("test")
}
mesEntiers.pop();
}
} // Fin fonction supprimer.
