# \[mx\] random function for an array

**URL:** https://forum.kirupa.com/t/mx-random-function-for-an-array/112517
**Category:** Uncategorized
**Created:** [June 8, 2004, 5:51pm UTC](https://forum.kirupa.com/t/mx-random-function-for-an-array/112517 "2004-06-08T17:51:34Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![kdzines](https://avatars.discourse-cdn.com/v4/letter/k/7ea924/32.png) [@kdzines](https://forum.kirupa.com/u/kdzines)
#### Post date: [June 8, 2004, 5:51pm UTC](https://forum.kirupa.com/t/mx-random-function-for-an-array/112517/1 "2004-06-08T17:51:34Z")

</div>

hey,

this should be pretty easy

i have 16 movie clips on my stage and they all have visibility = 0;

when i reach the frame with the mcs, i want 1 to be visible. Now i know how to do that. but i only want 1 to be visible out of 6 possibilities. so the frame always has 1 out of a defined 6 mcs visible.

i thought this might work:

var getVisible = [“9”, “2”, “13”, “15”, “8”, “10”];

k = getVisible[random];

now that’s not right, so anybody know how to write the 2nd line correctly?

thanks,

kd
