for (counter = 1; counter <= 3; counter++) { _root.imageNum["imgBut" + counter].onRelease = function () { _root.galleryLoader.loadClip (counter + ".jpg", _root.galleryImages); } }