next and prev image problem in actionscript

UK-1991 0 Tallied Votes 152 Views Share

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

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"});
}