# Can u explain this code?

**URL:** <https://forum.kirupa.com/t/can-u-explain-this-code/172473>\
**Category:** flash\
**Created:** [December 14, 2005, 6:44pm UTC](https://forum.kirupa.com/t/can-u-explain-this-code/172473 "2005-12-14T18:44:27Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Knorcedger](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/knorcedger/32/1244_2.png) [@Knorcedger](https://forum.kirupa.com/u/Knorcedger)\
**Post date:** [December 14, 2005, 6:44pm UTC](https://forum.kirupa.com/t/can-u-explain-this-code/172473/1 "2005-12-14T18:44:27Z")

</div>

```auto
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
