Variables

var P1cuori=0

function contapunti(a,b,c)
{
var i:int;
for (i = 0; i < 10; i++)
{
if (a.indexOf(b*)!=-1)
{
if(i==0){c += 11}
if(i==1){c += 10}
if(i==2){c += 4}
if(i==3){c += 3}
if(i==4){c += 2}
if(i==5){c += 0.5}
if(i==6){c += 0.4}
if(i==7){c += 0.3}
if(i==8){c += 0.2}
if(i==9){c += 0.1}
trace (P1cuori)
}
}
}

//CONTROLLO PUNTI DEI GIOCATORI

contapunti(Player1,cuori,P1cuori)

Hi all, i have this code… i dont understand why the value of the variable P1cuori remains to 0 while c value increases… any help?