# Stopping timed movies

**URL:** https://forum.kirupa.com/t/stopping-timed-movies/91136
**Category:** Uncategorized
**Created:** [September 29, 2003, 3:16pm UTC](https://forum.kirupa.com/t/stopping-timed-movies/91136 "2003-09-29T15:16:56Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![jondj24](https://avatars.discourse-cdn.com/v4/letter/j/5f9b8f/32.png) [@jondj24](https://forum.kirupa.com/u/jondj24)
#### Post date: [September 29, 2003, 3:16pm UTC](https://forum.kirupa.com/t/stopping-timed-movies/91136/1 "2003-09-29T15:16:56Z")

</div>

if i have a randomClips function that shows a range of swf files every 15seconds and wanted to create a button that could stop the auto change of the clips, what would be the script for that button if the script for the randomClips looks like this:

```auto

randomClips = new Array("d+l A_news.swf", "maashaven B_news.swf", "maashaven A_news.swf", "gipsy A_news.swf", "gipsy B_news.swf", "d+l B_news.swf", "gw A_news.swf", "gw B_news.swf", "soundscapes A_news.swf", "soundscapes B_news.swf", "fhwsf A_news.swf", "fhwsf B_news.swf");
function randomBackground() {
	randomNumber = random(randomClips.length);
	loadMovie(randomClips[randomNumber], "_root.mtClip");
}
randomBackground();
timeLimit = 15000;
// for example 15 seconds
startTime = getTimer();
actualTime = getTimer();
function timerReload() {
	if (actualTime-startTime<=timeLimit) {
		actualTime = getTimer();
	} else {
		randomBackground();
		startTime = getTimer();
	}
}
// creating an empty movie clip so I can use it's onEnterFrame event
this.createEmptyMovieClip("emptyClip", 1);
emptyClip.onEnterFrame = timerReload;

```

thanks.  
jonathan
