# If Statement Problems

**URL:** <https://forum.kirupa.com/t/if-statement-problems/196239>\
**Category:** flash\
**Created:** [August 7, 2006, 3:44am UTC](https://forum.kirupa.com/t/if-statement-problems/196239 "2006-08-07T03:44:48Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jcox12](https://avatars.discourse-cdn.com/v4/letter/j/8e8cbc/32.png) [@jcox12](https://forum.kirupa.com/u/jcox12)\
**Post date:** [August 7, 2006, 3:44am UTC](https://forum.kirupa.com/t/if-statement-problems/196239/1 "2006-08-07T03:44:48Z")

</div>

So here is my code below: I declared the variable in the first frame of the movie at the \_root level. the trace returns false but for some reason the code goes into the first if statement as if the variable was set to true…any ideas why this may be happening?

stop();  
trace(\_root.viewHeadlines);  
if (\_root.viewHeadlines = true) {  
trace(“I am goin to show Headlines”);  
this.\_parent.gotoAndStop(3);  
}  
if(\_root.viewHeadlines = false){  
trace(“I am in frame 4”);  
this.\_parent.gotoAndStop(4);  
}
