[AS2 CS4]basic variables question

Hi,
I want to edit a variable in _root from a function

it should look like this:

var index:number = 0;

function fnct (root_counter){
              root_counter ++;    
}

fnct(index);
trace (index) // 1

fnct(index);
trace (index) // 2

fnct(index);
trace (index) // 3

well this way it isn’t working :slight_smile:
hope you can help!