lundi 4 mai 2015

IF-Statment inseide a double for loop?

How do i execute an IF statment inside a double for loop, checking if an object in an array equals the selectedItem.label? Here is my try! (didn't work)

function klikkA(evt:Event):void{
for( var j:int = 0; j < 4; j++)
{
    for (var k:int = 0; k < 8; k++)
    {
        if (listeA.selectedItem.label != myArray[j][k])
        {
            continue;
        }
         else if(listeA.selectedItem.label == myArray[j][k])
        {
            txtFlagg.text = myArray[j][k];
            break;
        }
    }  
}

}

Aucun commentaire:

Enregistrer un commentaire