# FLASH 8: Ensure No Repeats w/ Randomly Loading SWFs

**URL:** <https://forum.kirupa.com/t/flash-8-ensure-no-repeats-w-randomly-loading-swfs/195854>\
**Category:** flash\
**Created:** [August 3, 2006, 4:28pm UTC](https://forum.kirupa.com/t/flash-8-ensure-no-repeats-w-randomly-loading-swfs/195854 "2006-08-03T16:28:24Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![MiddleFingerMan](https://avatars.discourse-cdn.com/v4/letter/m/bbce88/32.png) [@MiddleFingerMan](https://forum.kirupa.com/u/MiddleFingerMan)\
**Post date:** [August 3, 2006, 4:28pm UTC](https://forum.kirupa.com/t/flash-8-ensure-no-repeats-w-randomly-loading-swfs/195854/1 "2006-08-03T16:28:24Z")

</div>

I’m loading in random SWF files into a header file with the following code:

```auto
loadMovie("headers/coldfx.swf","swf_mc");

var movieArray:Array = ["headers/coast.swf", "headers/coldfx.swf", "headers/enervest.swf", "headers/fairplay.swf", "headers/interpipe.swf", "headers/mantra.swf", "headers/westin.swf"];

function loadSwf() {
    swf_mc.loadMovie(movieArray[Math.floor(Math.random()*(movieArray.length-0))]);
}

function startMyInterval() {
    myInterval = setInterval(loadSwf, 30000);
}

startMyInterval();

```

I would love to be able to ensure that the same SWF is not loaded twice in a row.

Also I would like to be able to trace the loaded SWF. Is it possible to load the name of the currently loaded SWF into a variable or something?

Thanks!
