# Stop movie randomizer

**URL:** https://forum.kirupa.com/t/stop-movie-randomizer/290234
**Category:** Uncategorized
**Created:** [June 11, 2009, 3:00pm UTC](https://forum.kirupa.com/t/stop-movie-randomizer/290234 "2009-06-11T15:00:51Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![jet71dl](https://avatars.discourse-cdn.com/v4/letter/j/8797f3/32.png) [@jet71dl](https://forum.kirupa.com/u/jet71dl)
#### Post date: [June 11, 2009, 3:00pm UTC](https://forum.kirupa.com/t/stop-movie-randomizer/290234/1 "2009-06-11T15:00:51Z")

</div>

Hello!

I have several ‘buttons’ that blink randomly using this function:

```auto
function movieRandomizer(){
      num = Math.floor(Math.random()*14)+1
      movie = "mc" + num;
      eval(movie).play();
}

movieRandomizer();

setInterval(movieRandomizer, 500);

```

What I would like to do is to stop the randomizer from playing on the button that is pressed/active and when the button is clicked again to stop the animation it controls, to continue to randomly blink with the other buttons…

Attached is a test .fla for y’all to look at, only the 4 purple buttons on the bottom are clickable (don’t go any where yet…). The clicked/active state is when the button is glowing…

Any help would be great! Thanks.
