If statement help

I have a site with 4 submenus that load various swfs…what i need to do is make the buttons in the submenus stay in their rollover (active) states when clicked. I cant figure out how to write this with the script - Is there a way to tell the button to stay in its “active” state when it’s swf is loaded - and then go to its “normal” state when another button’s swf is loaded? I’m loading all the swfs into an empty movie clip called “content”. Here’s the site, only the 1st button (Philosophy) and 2nd (Passion) menus are working so far.

http://www.bondcreates.com/flashtest/site.html

what i have done so far is put the buttons on a timeline so it would go to a frame with a dead “active” state of that button - but this won’t work because if you open another submenu (passion) and go back to (philosophy) it stays stuck on that dead “active” button while another swf might be loaded in the content…not good at all.

make the button an mc with two frames, normal and over. instance name of ‘b1’. Add this code to the frame 1 of the MAIN timeline.

b1.clicked=false
b1.onRollOver= function(){
b1.gotoAndStop(2) }
b1.onRollOut= function(){
if(!b1.clicked) b1.gotoAndStop(1)}
b1.onPress= function(){
if(b1.clicked){
b1.gotoAndStop(1)
b1.clicked=false
}
else{
b1.gotoAndStop(2)
b1.clicked=true}}

Hey kartik, thanks for that reply. Is this possible with Flash 5? I showed a friend the script and he said it may not be…and that i’d have to code this for each button on my submenus - meaning i’d have 19 buttons in total. Would i just continue this code using “b1” all the way through “b19”?

onClipEvent(mouseMove){
if(hitTest(_root._xmouse,_root._ymouse,false)){
touch=true
this.gotoAndStop(2)
}
else{
if(touch==true){
touch=false
if(!clicked){
this.gotoAndStop(1)
}}}}
onClipEvent(mouseDown){
if(hitTest(_root._xmouse,_root._ymouse,false)){
if(!clicked){
clicked=true
gotoAndStop(2)}
}
else{
clicked=false
gotoAndStop(1)
}
}

add this to your button mc.