Can u explain this code?

ball.onEnterFrame = function() {
	for (i=0; i<2; i++) {
		ball.onRollOver = function() {
			trace(i);
		};
	}
};

Can please somebody explain to me why it always traces “2”?

Thanx