# Random Clip Instances

**URL:** https://forum.kirupa.com/t/random-clip-instances/177150
**Category:** flash
**Created:** [January 30, 2006, 5:56pm UTC](https://forum.kirupa.com/t/random-clip-instances/177150 "2006-01-30T17:56:11Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![pyromunky](https://avatars.discourse-cdn.com/v4/letter/p/8e8cbc/32.png) [@pyromunky](https://forum.kirupa.com/u/pyromunky)
#### Post date: [January 30, 2006, 5:56pm UTC](https://forum.kirupa.com/t/random-clip-instances/177150/1 "2006-01-30T17:56:11Z")

</div>

I have a row of blinking clip instances on the root timeline which I’m trying to play at random intervals. I have thirteen clips, named blink\_1, blink\_2, and so on. I placed the function below on the root timeline to play the clips, but it’s not working. Can anyone see something I’m missing?

* * *

function blink() {  
var i = Math.round(Math.random()\*200);  
if (i\<5) {  
ii = Math.round(Math.random()\*13);  
var clipNum = String(ii);  
var thisClip = String(“blink\_”+clipNum);  
trace(thisClip);  
thisClip.gotoAndPlay(2);  
}  
}
