# Rotating image gallery at interval, with pause on hover

**URL:** <https://forum.kirupa.com/t/rotating-image-gallery-at-interval-with-pause-on-hover/309467>\
**Category:** flash\
**Created:** [May 16, 2010, 12:59pm UTC](https://forum.kirupa.com/t/rotating-image-gallery-at-interval-with-pause-on-hover/309467 "2010-05-16T12:59:52Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![senkei](https://avatars.discourse-cdn.com/v4/letter/s/94ad74/32.png) [@senkei](https://forum.kirupa.com/u/senkei)\
**Post date:** [May 16, 2010, 12:59pm UTC](https://forum.kirupa.com/t/rotating-image-gallery-at-interval-with-pause-on-hover/309467/1 "2010-05-16T12:59:52Z")

</div>

EDIT: It seems that after sometime working on this i have been able to come up with something which works the way i want it too, however there’s this small problem. When i hover really fast over my buttons, it feels like flash just has a meltdown and stops running the function i have inside my button onRollOut. Can someone take a peak and see why this is happening?

So i got 5 frames with names “marine”, “architectural”, etc

In the first frame “marine” there is the following code (i’ve only included 1 of the buttons, but there another 4 with identical code where appropriate):

```auto
stop();
//enter current[] and goto[]
//current[marine][2] -> next[architectural][3]
mBtn.gotoAndStop("on");//current, everything else not current off (below) [copy "currentBtn" 4]
aBtn.gotoAndStop("off");
dBtn.gotoAndStop("off");
vBtn.gotoAndStop("off");
iBtn.gotoAndStop("off");

waitTime = setInterval(nextImage, delay);
function nextImage() {
	if (mouseHover == 1) {
		for (i=0; i<=1000; i++) {
			clearInterval(i);
		}
	} else {
		gotoAndPlay("architectural");//[paste "next" 25]
		pSlide.gotoAndStop(2);//[paste 19-21]
		offAlpha = Math.round((mSlide._currentframe/15)*100);
		pSlide._alpha = offAlpha;
		trace(pSlide._currentframe);
		trace(pSlide._alpha);
		for (i=0; i<=1000; i++) {
			clearInterval(i);
		}
	}
}

mBtn.onRollOver = function() {//[paste "currentBtn" 4]
	gotoAndStop("marine");//change "current"
	mouseHover = 1;
	for (i=0; i<=1000; i++) {
		clearInterval(i);
	}
}

mBtn.onRollOut = function() {//[paste "currentBtn" 4]
	pSlide.gotoAndStop(2);//change(currentNumber) [copy 19-21]
	offAlpha = Math.round((mSlide._currentframe/15)*100);//currentSlide
	pSlide._alpha = offAlpha;
		trace(pSlide._currentframe);
		trace(pSlide._alpha);
	mouseHover = 0;
	waitTime = setInterval(nextImage, delay);
	function nextImage() {
		gotoAndPlay("architectural");//change "next" [copy "next" 25]
		for (i=0; i<=1000; i++) {
			clearInterval(i);
		}
	}
}

```
