Variable problems

I’m making a navigation bar.
when u click on a button, i would like an indicator to appear above the button.
i create a separate movie clip, which is the indicator, that starts offscreen and moves to its position when the user rolls over the button, and then stays there if the user clicks the button, but disappears when the user rolls out without clicking.

here’s my script i got so far:


on (rollOver) {
	tellTarget (indicator) {
		gotoAndPlay(1);
	}
	set (x,1);
}
on (release) {
	tellTarget (indicator) {
		gotoAndStop(10);
	}
}
on (rollOut) {
	if (x=1) {
	tellTarget (indicator) {
		gotoAndStop(10);
	}
	} else {
	tellTarget (indicator) {
		gotoAndStop(1);
	}
}
}

frame1 would be the indicator offscreen, and when played would bring the indicator to it’s position at frame10. the problem i have right now is that when i rollout without or without clicking, the idicator stays at frame10; and the rollover event seems to work only the first time.
i’m kinda new at variables…have i done it right?
thx :slight_smile:

Hi,


on (rollOver) {
indicator.gotoAndPlay(2);
x=0;	
}
on(press){
x=1;
}
on (release) {	
	//no action for indicator	
}
on (rollOut) {
	if (x!=1) {
	indicator.gotoAndStop(1);	
	} 

}


Cheers

SHO

Ps.: in 'if statements equal has to be double(== ).

whoo~ ok…thx…

U r welcome

SHO