var n=5; var way=Math.round(Math.random()*(n-1)+1); this.attachMovie("mc"+way,"mc",this.getNextHighestDepth());