# If else problem

**URL:** <https://forum.kirupa.com/t/if-else-problem/284951>\
**Category:** Uncategorized\
**Created:** [March 25, 2009, 2:07pm UTC](https://forum.kirupa.com/t/if-else-problem/284951 "2009-03-25T14:07:16Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shayna](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/shayna/32/1187_2.png) [@Shayna](https://forum.kirupa.com/u/Shayna)\
**Post date:** [March 25, 2009, 2:07pm UTC](https://forum.kirupa.com/t/if-else-problem/284951/1 "2009-03-25T14:07:16Z")

</div>

I am having problems with this if else statement.

I have a variable (frame number 30) passing into my swf from another swf. This I know is working correctly.

```auto
on (release) { getURL("http://www.website.com/land.html?stateVar=30"); }

```

I am directing the swf to start on different frame numbers depending on the variable, this is working.

But when I place this code:

```auto
if(stateVar==30){
gotoAndPlay(30);
}
else{
stop();
}

```

I have also tried this:

```auto
if(stateVar=="30"){
gotoAndPlay(30);
}
else{
stop();
}

```

(in case it was a string vs number issue.)

it just stops - it does not go to frame 30.

I need this because I need the file to stay on frame 1 if no variable is passed in.

Am I doing something obvious wrong?  
Is there a better way to do this?

Thanks in advance  
Shawn
