# Dynamic mask w Interval crashing flashplayer

**URL:** <https://forum.kirupa.com/t/dynamic-mask-w-interval-crashing-flashplayer/77443>\
**Category:** flash\
**Created:** [January 27, 2005, 8:42am UTC](https://forum.kirupa.com/t/dynamic-mask-w-interval-crashing-flashplayer/77443 "2005-01-27T08:42:46Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![henkedo](https://avatars.discourse-cdn.com/v4/letter/h/6bbea6/32.png) [@henkedo](https://forum.kirupa.com/u/henkedo)\
**Post date:** [January 27, 2005, 8:42am UTC](https://forum.kirupa.com/t/dynamic-mask-w-interval-crashing-flashplayer/77443/1 "2005-01-27T08:42:46Z")

</div>

Hi All.

Have problem with a image gallery that uses a dynamic mask for image transitions and interval to go to the next frame where the process is repeated with the new image.  
Is there an ifinite loop somewhere… I’m kind of new to AS so my debugging sucks.

```auto

// TIME DELAY 
var delay = 4000;

// FUNCTIONS 
function goNext() {
	nextFrame();
	clearInterval(waitInt);
}
function imgWipe() {
	cols = image_mc._width/square_mc._width;
	rows = image_mc._height/square_mc._height;
	height = square_mc._height;
	width = square_mc._width;
	d = 10;
	createEmptyMovieClip('holder', 1);
	holder._x = image_mc._x;
	holder._y = image_mc._y;
	startY = 18;
	startX = 18;
	for (var r = 0; r<=rows; r++) {
		for (var c = 0; c<=cols; c++) {
			newClip = holder.attachMovie("square_mc", "clip"+r+c, d++);
			newClip._x = (c*width)+startX;
			//trace(newClip._x);
			newClip._y = (r*height)+startY;
			
		}
	}
	image_mc.setMask(holder);
}

```

And in each new frame:

```auto

stop();
imgWipe();
var waitInt = setInterval(goNext,delay);

```

Any help is appreciated, I can post a .fla if needed.

thanks  
.henkedo
