for (i=1; i <= 10; i++) { _root.main["region"+i].i = i; _root.main["region"+i].onRollOver = function() { trace(this.i); }; }