I don’t really know actionscript very well, I just learn whatever I need to do to finish my website. Right now I am updating it and want to make my menu move around depending on what is selected. I am a photographer, and my site is very centered and focused on the photographs. What I want to do is make a button move to the center after it is clicked, and the other buttons rearrange.
So, say Argentina is first selected, it should move the center, and California and Concerts should move to the left one spot. Currently I have it working to a point, but can’t figure out where to go from here to make it work.
Right now I am using this at the point in the timeline where the Argentina button would be clicked:
this.onEnterFrame = function() {
if (this.About._x >0) {
speed = -20;
this.About._x += speed;
}
if (this.Argentina._x <383.5) {
speed = 15;
this.Argentina._x += speed;
}
if (this.California._x >127.5) {
speed = -10;
this.California._x += speed;
}
if (this.Concerts._x >256) {
speed = -5;
this.Concerts._x += speed;
}
if (this.Kansas._x <512) {
speed = 5;
this.Kansas._x += speed;
}
if (this.MovieSets._x <640.5) {
speed = 10;
this.MovieSets._x += speed;
}
if (this.Timelapse._x <765) {
speed = 15;
this.Timelapse._x += speed;
}
}
So, this is obviously missing something big. The buttons can be in multiple possitions and must be moved left OR right. I just have one direction right now. If I add another “if” statement sending the button the other direction it jitters around.
Also, I am running into a weird glitch where the 0 position on the x axis isn’t always the same, even though the buttons are all just copies, and About starts at 0, yet when it moves back, it doesn’t stop at the same spot.
Any help would be much appreciated. I am sure I’m just doing something totally wrong.