Keeping score

i am making a small game and after finishing g the hit test to keep my character on top of the moving objects on the stage i wanted to keep the score so i added this little piece of code to one of the already available functions in the code but it only counts the score once and does not increment it why ?

var score:String

//loop to check if the char hit the line on top & bottom of the step or not.
for (var i = 0; i<steps; i++)
{
if (ball.hitTestObject(lineBot*))
    {
        SpaceKeyStatus = "spaceReleased";
        
    }
    

if (ball.hitTestObject(lineTop*))
    {            
            ball.y=lineTop*.y-ball.height;
            score +=10;
            score_txt.text = score
    }
}