test = function() { ... var i = 0; i = 2; ... var item = _root['item'+i]; item.i = i; item.onRollOver = function() { trace(this.i); } }