for (n = 2; n < 7; n++) { var top_b = _root.top_menu["top_b" + n]; top_b.n = n; top_b.onPress = function () { trace (this.n); trace (this.menu_title_mc); }; }