for (var i = 1; i<=3; i++) { this["btn"+i].onRelease = function() { var txt:LoadVars = new LoadVars(); txt.onLoad = function() { out_txt.text = txt.txt; }; txt.load(i+".txt"); }; }