Hello, I have this code and file. It works, but I want just one movie clip to play randomly, not two, or three. Please help!
Code:var clips:Array = ["redl_mc", "blue_mc", "green_mc"]; playRandomMC(); function playRandomMC() { var index:Number = Math.floor(Math.random()*clips.length); for (var i:Number = 0; i<clips.length; i++) { var mc:MovieClip = _root[clips[i]]; if (i == index) { mc._visible = true; mc.play(); } else { mc._visible = false; mc.stop(); } } }




Reply With Quote
Bookmarks