# Trouble with if/else statement

**URL:** <https://forum.kirupa.com/t/trouble-with-if-else-statement/148268>\
**Category:** Uncategorized\
**Created:** [May 18, 2005, 3:04pm UTC](https://forum.kirupa.com/t/trouble-with-if-else-statement/148268 "2005-05-18T15:04:13Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![leahgrace](https://avatars.discourse-cdn.com/v4/letter/l/f17d59/32.png) [@leahgrace](https://forum.kirupa.com/u/leahgrace)\
**Post date:** [May 18, 2005, 3:04pm UTC](https://forum.kirupa.com/t/trouble-with-if-else-statement/148268/1 "2005-05-18T15:04:13Z")

</div>

I’m trying to right some script that says when a user rolls over this button it should go to the 2nd frame (visible, 1st frame is empty) of a particular movieclip. But I want to be sure that none of the other movieclips on the stage are showing, so I wrote this if/else statement to say that if the currentframe of the other movieclip is 1 (not showing) then go stop on the 2nd frame of this movieclip. If not, go stop on frame 1 of the other movieclip and then go stop on frame 2 of this movie clip. Here is the code below. Someone please tell me why it’s not working. I have the code on the instance of the button. The button and both movie clips are on the main stage.

on (rollOver) {  
if (\_root.insured\_mc.\_currentframe=1) {  
polNum\_mc.gotoAndStop(2);  
} else {  
\_root.insured\_mc.gotoAndStop(1);  
polNum\_mc.gotoAndStop(2);  
}  
}

When I publish the SWF, i make sure that insured\_mc is on frame 2, to test the code, then I rollover the button in question and polNum\_mc goes to the 2nd frame too, but insured\_mc doesn’t turn off (go to frame 1).
