Hi,
I’m making a simple photo gallery using the great easing tutorial by Voetsjoeba. There’s a bar movieclip with buttons inside, the buttons are numbers 1-20. When you click on a number, the bar slides into an X position, bringing that number to the center of a highlighted area. Then there’s a next and a previous arrow to advance one by one. Pretty simple… But I’m still learning my variables so I’m not sure how to make the next and previous buttons work.
I have the X positions defined for each number like this:
nX1 = 393;
nX2 = 340;
etc.
Then I’m moving each number like this:
//n2 is the instance name of the #2 button
bar.n2.onRelease = function(){
_root.bar.easeX( nX2, 1.35 );
nextX = nX3;
prevX = nX2;
}
bar.n2.onRelease;
And the next button works like this:
Bnext.onRelease = function(){
_root.bar.easeX( nextX, 1.35 );
}
Since the movie starts with #1,
nextX = nX2;
And it does go to the next number, but only once, as it’s not updating the value of nextX, same goes for the previous button. I feel like there must be an easy way to do this, but I can’t figure it out… Any help would be much appreciated!!!