Join Login


Video Tutorials
Blog



PrintPlace.com Online Full Color Printing

Create an Automatic Image Gallery with Thumbnails


By: RiverCityGraphix      Views: 11487      Share: Bookmark and Share

In this tutorial, you will learn how to create an automatic image gallery with thumbnails by combining two of my previous tutorials.

In this gallery, the images will run on their own in a continuous loop until you click a thumbnail. When you mouse off of the thumbnail the gallery will being to play again. Good luck with creating your automatic image gallery in Flash!

AS3 Code (1st Frame)
var nextImage:Timer = new Timer(2000);
nextImage.addEventListener(TimerEvent.TIMER, playNext);
nextImage.start();

function playNext(event:Event):void{
	nextFrame();
}


AS3 Code (2nd Frame)
stop();
//////////////////////////////////////////////////////////////////
btn1.addEventListener(MouseEvent.CLICK,play1);

function play1(event:MouseEvent):void{
	nextImage.stop();
	gotoAndStop(2);
	btn1.addEventListener(MouseEvent.ROLL_OUT, rollout);
	
	function rollout(event:MouseEvent):void{
		nextImage.reset();
		nextImage.start();
	
	}
}
//////////////////////////////////////////////////////////////////
btn2.addEventListener(MouseEvent.CLICK,play2);

function play2(event:MouseEvent):void{
	nextImage.stop();
	gotoAndStop(3);
	btn2.addEventListener(MouseEvent.ROLL_OUT, rollout);
	
	function rollout(event:MouseEvent):void{
		nextImage.reset();
		nextImage.start();
	
	}
}

btn3.addEventListener(MouseEvent.CLICK,play3);

function play3(event:MouseEvent):void{
	nextImage.stop();
	gotoAndStop(4);
	btn3.addEventListener(MouseEvent.ROLL_OUT, rollout);
	
	function rollout(event:MouseEvent):void{
		nextImage.reset();
		nextImage.start();
	
	}
}

btn4.addEventListener(MouseEvent.CLICK,play4);

function play4(event:MouseEvent):void{
	nextImage.stop();
	gotoAndStop(5);
	btn4.addEventListener(MouseEvent.ROLL_OUT, rollout);
	
	function rollout(event:MouseEvent):void{
		nextImage.reset();
		nextImage.start();
	
	}
}


AS3 Code (Last Frame)
nextImage.stop();
nextImage.reset();
gotoAndPlay(1);




Free Source Files Zip