# If-then statement & variables

**URL:** <https://forum.kirupa.com/t/if-then-statement-variables/173483>\
**Category:** flash\
**Created:** [December 26, 2005, 7:27am UTC](https://forum.kirupa.com/t/if-then-statement-variables/173483 "2005-12-26T07:27:47Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Soig](https://avatars.discourse-cdn.com/v4/letter/s/eada6e/32.png) [@Soig](https://forum.kirupa.com/u/Soig)\
**Post date:** [December 26, 2005, 7:27am UTC](https://forum.kirupa.com/t/if-then-statement-variables/173483/1 "2005-12-26T07:27:47Z")

</div>

Hi, this is my first time using variables and If then statements, and I’m a bit stuck. What I want to achieve is to have a button, but if it has been clicked, I do not want it to be useful until another button has been clicked. The website starts in the news section so I did this

currentlyLoaded = “news”; \<-- Global variable

Then I set it up so that each time a button is pressed, it’s section becomes the “currentlyLoaded”. And finally I put in this if - then statement.

if(currentlyLoaded != “news”){  
\_root.clearPage();  
}

I have traced my variable (currentlyLoaded) and I know it is news, but for some reason my if-then statement plays whether it IS news or it is NOT. Any help would be greatly appreciated! Thanks
