for (i = 0; i <= 3; i++) { _root["b" + i].i = i; _root["b" + i].onPress = function () { _root.gotoAndPlay (this.i + 1); }; }