I'm working on a program to learn how to use arrays in my computer course and my display button doesn't work properly after the first press. The first time I click it, it works properly and displays everything but the 2nd time it stop showing the first value and starts showing the last value twice, the 3rd time cuts off the 2nd value and displays the last value three times and so on. And when I press the button to find the sum of all values it gives me the sum of all of the values that will show up after I hit the display button. Here's my code, and sorry about the french commentary, it's for school.
function afficherFunction(event:MouseEvent):void
{
// Compose cette fonction visant à afficher tous les éléments du tableau.
txtSortie.text = "";
var entier:int;
entier = -1
for (var i:int=entier; i < mesEntiers.length; i++)
{
if (i+1 < mesEntiers.length)
{
mesEntiers[i] = mesEntiers[i+1];
affichage = affichage + mesEntiers[i] + "\n"
}
}
txtSortie.text = affichage;
affichage = "";
i = -1;
} //Fin fonction afficher.