# Random problem

**URL:** https://forum.kirupa.com/t/random-problem/321425
**Category:** flash
**Created:** [April 19, 2011, 4:18pm UTC](https://forum.kirupa.com/t/random-problem/321425 "2011-04-19T16:18:09Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![12abhi12](https://avatars.discourse-cdn.com/v4/letter/1/9f8e36/32.png) [@12abhi12](https://forum.kirupa.com/u/12abhi12)
#### Post date: [April 19, 2011, 4:18pm UTC](https://forum.kirupa.com/t/random-problem/321425/1 "2011-04-19T16:18:09Z")

</div>

I have four movie clips (mc1, mc2, mc3, mc4). Upon clicking a button (btn), two of the mc’s should disappear. Which two will disappear should be random. But there is one condition. There is a variable (say, k). An mc, mc\* can disappear only if i != k.

I tried this in various ways, but in each way either an mc is taken twice or the value of i is more than 4 or less than 0.

I can see only one fool-proof method to do this but it is lengthy and unprofessional. Any help would be appreciated.
