onclick next button change the marker Tween:Tween position
I have a file which is having some buttons at the bottom like and two buttons at the left and right sides called "next_btn" nad "prev_btn" also a tween which is folowing the buttons at the bottom when they are being clicked. The action is folowing below.
My problem is i want to change the tween position when i am clicking on the "next_btn" and Prev_btn" suppose if the tween arrow is on the "button 3" currently the moment i am clicking on the next_btn the tween arrow should go the "button 4" accordingly if i click on the rev button it should go to the "button 2".
Here is the sample which i am trying to do http://www.franklincovey.com/tc/
Basically i want to say that i want to make this banner and i have reached till this stage after this i am not being able to do further, need your valuable support.
I would request you to download this flash file which is containing everything
Download - http://www.touchpixl.com/files.zip
Here is the code that i am using
Layer 1 - Frame 1
next_slide.addEventListener(MouseEvent.MOUSE_UP,buttonPressed);
prev_slide.addEventListener(MouseEvent.MOUSE_UP,buttonClicked);
function buttonPressed(event:MouseEvent){
if(holder.currentFrame == 1)
{
holder.nextFrame();
trace("Clicked 1");
}
else if(holder.currentFrame == 2)
{
holder.nextFrame();
trace("Clicked 2");
}
else if(holder.currentFrame == 3)
{
holder.nextFrame();
trace("Clicked 3");
}
else if(holder.currentFrame == 4)
{
holder.nextFrame();
trace("Clicked 4");
}
else if(holder.currentFrame == 5)
{
holder.nextFrame();
trace("Clicked 5");
}
else if(holder.currentFrame == 6)
{
holder.gotoAndStop(1);
trace("Clicked 6");
}
}
function buttonClicked(event:MouseEvent){
if(holder.currentFrame == 1)
{
holder.gotoAndStop(6);
trace("Clicked 1");
}
else if(holder.currentFrame == 2)
{
holder.prevFrame();
trace("Clicked 2");
}
else if(holder.currentFrame == 3)
{
holder.prevFrame();
trace("Clicked 3");
}
else if(holder.currentFrame == 4)
{
holder.prevFrame();
trace("Clicked 4");
}
else if(holder.currentFrame == 5)
{
holder.prevFrame();
trace("Clicked 5");
}
else if(holder.currentFrame == 6)
{
holder.prevFrame();
trace("Clicked 6");
}
}
Layer 2 - Frme 1
import fl.transitions.Tween;
import fl.transitions.easing.*;
var curMarkerXPos:Number = btn1.x;
var duration:Number = 1.5;
function markerFollow (event:MouseEvent):void {
var markerTween:Tween = new Tween(marker, "x", Strong.easeOut, curMarkerXPos, event.target.x, duration, true);
curMarkerXPos = event.target.x;
}
btn1.addEventListener(MouseEvent.CLICK, markerFollow);
btn2.addEventListener(MouseEvent.CLICK, markerFollow);
btn3.addEventListener(MouseEvent.CLICK, markerFollow);
btn4.addEventListener(MouseEvent.CLICK, markerFollow);
btn5.addEventListener(MouseEvent.CLICK, markerFollow);
btn6.addEventListener(MouseEvent.CLICK, markerFollow);
