PDA

View Full Version : Button Issues


rodger4200
09-06-2006, 12:55 AM
I am having problems with some buttons that I got off ffiles.com. I want these buttons to play forward in the time line but I am not sure how that code works. if anyone can help I would be so appericative here is the code. I will post the files also

bt1.nomme = "HOME";
bt2.nomme = "ABOUT";
bt3.nomme = "CONTACT";
bt1.onRelease = function() {
bt1.enabled = false;
bt2.enabled = true;
bt2.voltar = true;
bt3.enabled = true;
bt3.voltar = true;
}
bt2.onRelease = function() {
bt1.enabled = true;
bt1.voltar = true;
bt2.enabled = false;
bt3.enabled = true;
bt3.voltar = true;
}
bt3.onRelease = function() {
bt1.enabled = true;
bt1.voltar = true;
bt2.enabled = true;
bt2.voltar = true;
bt3.enabled = false;
}

rodger4200
09-06-2006, 12:58 AM
here are the files

graylensman
09-06-2006, 01:57 AM
You're missing some significant code. This was placed on the button instances themselves:

this.stop();
this.onEnterFrame = function() {
if (voltar == true) {
this.prevFrame();
}
}
this.onRollOver = function() {
this.play();
voltar = false;
}
this.onRollOut = function() {
voltar = true;
}

this code controls the motion tweening you see on rollOver and rollOut. "voltar" is a boolean variable that's set to true or false, depending. This in turn determines whether or not the motion is activated. In the code you posted, the various buttons are enabled or disabled depending on what's been clicked and the "voltar" boolean is set. btn.nomme="HOME" is simply code that places the string "HOME", etc. into a dynamic text box in the button movie clip.

What you're planning to do with this, though, I don't know, so I can't say how these buttons will work with your project.