Hey, I have this code for part of a website I am working on and I have run into a problem. Basically, I have a series of navigation buttons that when you roll over them another small graphic on the stage moves up or down, depending on the roll over/out mouse state. That part works fine. The second part of the code which is having mixed results is that when you press the button, I wanted to have the corrosponding graphic remain at the rollOver state until I press another button. Then it would return to its original state and the mc associated with the new button I pressed would move and remain in that position.
Here is the code I am using:
[COLOR="Gray"]*/This is the code that moves up the nav_display_mc button up 40 px.
*/nav_btn is the main nav button and the first part is just checking to see if it equals 5[/COLOR]
on (rollOver) {
if (nav_btn !=5) {
nav_display_mc._y = 5;
}
}
[COLOR="Gray"]*/This is the code that returns nav_display_mc to is original position.[/COLOR]
on (rollOut) {
if (nav_btn !=5) {
nav_display_mc._y = 45;
}
}
[COLOR="Gray"]*/This is the tricky code. It drops all of the mc's to their original position
*/ except for the one associuated with this script. It also sets the variable
*/ nav_btn = 5 so that it won't drop back down. [/COLOR]
on (press) {
if (nav_btn !=5) {
nav_print_mc._y, "45";
nav_apparel_mc._y = "45";
nav_pack_mc._y, "45";
nav_identity_mc._y, "45";
nav_display_mc._y, "5";
nav_btn = 5
}
}
What is happening is that when I click on the buttons, they stay up fine, but when I click on another button, the mc that was persistantly up does not go down until I mouse over it. Also, all of the button instances are named the same, so that the variable value will fluctuate with each press.
Anyway, any help on this would be great! Thanks so much!