# Random increment

**URL:** <https://forum.kirupa.com/t/random-increment/193237>\
**Category:** flash\
**Created:** [July 5, 2006, 1:54pm UTC](https://forum.kirupa.com/t/random-increment/193237 "2006-07-05T13:54:17Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![americanloti](https://avatars.discourse-cdn.com/v4/letter/a/9fc29f/32.png) [@americanloti](https://forum.kirupa.com/u/americanloti)\
**Post date:** [July 5, 2006, 1:54pm UTC](https://forum.kirupa.com/t/random-increment/193237/1 "2006-07-05T13:54:17Z")

</div>

Hi guys,

I was wondering if anyobody could help me figuring out this thing.  
I have this function:

```auto

MovieClip.prototype.cascade = function() {
	var nInterval:Number = 200;
	var c:Number = 0;
	delay_fx = function () {
		if (c<_global.nTotal) {
			with (eval("this.thumbnail_mc.card"+c)) {
				fadeIn();
			}
		} else {
			clearInterval(delay);
		}
		c++;
	};
	delay = setInterval(delay_fx, nInterval);
};

```

The function is later being called in a loop. What I would like to do is to have the variable “c” to increment randomly from a value of 0 to a value stored in the global var nTotal without having any number repeat itself. Any hints would be greatly appreciated.

Thanks
