# Problems with if statements

**URL:** <https://forum.kirupa.com/t/problems-with-if-statements/201743>\
**Category:** flash\
**Created:** [September 24, 2006, 5:34pm UTC](https://forum.kirupa.com/t/problems-with-if-statements/201743 "2006-09-24T17:34:26Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![headless\_pnub](https://avatars.discourse-cdn.com/v4/letter/h/53a042/32.png) [@headless\_pnub](https://forum.kirupa.com/u/headless_pnub)\
**Post date:** [September 24, 2006, 5:34pm UTC](https://forum.kirupa.com/t/problems-with-if-statements/201743/1 "2006-09-24T17:34:26Z")

</div>

Hi, i’m trying to make a website ith a number of buttons and layers. In one section i need to have an if statement on the buttons as where in the timeline they go is dependant on where the user is (this location is set in a variable called “destination”.

The problem is that when i have = in the if statement it bypasses the first section and only does the else action (ie trace (“else”)), and if i put == in the statement it only does the first action (ie trace (“gallery”)) no matter what “destination” is.

here is my code:

on (release){  
if (destination = “gallery”){  
trace (“gallery”);  
}else{  
trace (“else”);  
}  
}

Can anyone see where i am going wrong? it’s driving me nuts.  
Thanks in advance,  
Pnub
