function attachRandomClip() { var num = Math.ceil(Math.random() * 5 + 1); var clip = _root.attachMovie("clip" + num, "newName", 1000, {_x:Stage.width / 2, _y:Stage.height / 2}); } var intvID = setInterval(attachRandomClip, 1000);