next and prev image problem in actionscript

UK-1991

below mentioned is my code.

My question is how do i make my b_btn to perform more then one action. Like when i click the back or forward button i want to make it more then one action. On clicking b_btn u go to image one and when we click on f_btn it goes to image two. I want when a again click onf_btn it takes me to image three and when clicked again so on. So how do i make this.

Thank You In Advance

132 Views
About the Author
import caurina.transitions.*;

var imageoneX : Number = 0;
var imagetwoX : Number = -550;
var imagethreeX : Number = -1100;

var buttons : Array = [b_btn,f_btn];

for (var i:int = 0; i< buttons.length ; i++){
	buttons[i].addEventListener(MouseEvent.CLICK,navigate);
}

function navigate(event:MouseEvent):void
{
	switch (event.target)
	{
		case(b_btn) : setTween(imageoneX);
		break;
		
		case (f_btn) : setTween(imagetwoX);
		break;
	}

}
	
function setTween(tweenX:Number):void{
	Tweener.addTween(content_mc, {x:tweenX, time:1, transition:"easeInOutCubic"});
}
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.