# If/else question

**URL:** <https://forum.kirupa.com/t/if-else-question/228823>\
**Category:** Uncategorized\
**Created:** [June 11, 2007, 8:06pm UTC](https://forum.kirupa.com/t/if-else-question/228823 "2007-06-11T20:06:32Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mehmet22](https://avatars.discourse-cdn.com/v4/letter/m/779978/32.png) [@mehmet22](https://forum.kirupa.com/u/mehmet22)\
**Post date:** [June 11, 2007, 8:06pm UTC](https://forum.kirupa.com/t/if-else-question/228823/1 "2007-06-11T20:06:32Z")

</div>

Hello everyone,

I am dabbling in if/else statements today and kind of ran into a problem and would greatly appreciate if someone can help me out. Here is what I have on my stage

I have a redRectangle

I have a alphaButton when clicked on it brings redRectangle alpha to 40 percent.

I have a ifButton that I am trying to incroprate if/else statement to.  
What I want to be able to do is see if the redRectangle is at 40 opacity I want to load 1.swf if not load 2.swf.

The problem I am running into is even if the opacity is at 40% the 2.swf is loaded instead of 1.swf.

import mx.transitions.Tween;  
import mx.transitions.easing;

alphaButton.onRelease=function(){  
new Tween(redRectangle, “\_alpha”, Elastic.easeOut, 100, 40, 1, true);  
}

ifButton.onRelease=function(){  
if(redRectangle.\_alpha == 40){  
loadMovie(“1.swf”, 2);

} else {  
loadMovie(“2.swf”, 2);  
}  
}

stop();
