for(var j=0; j<10; j++) { this["play_btn"+j].sndid = j; this["play_btn"+j].onRelease = loadSnd; } function loadSnd() { loadSound(this.sndid); }