# If/Else but button don't appear back

**URL:** <https://forum.kirupa.com/t/if-else-but-button-dont-appear-back/307503>\
**Category:** flash\
**Created:** [April 5, 2010, 1:50am UTC](https://forum.kirupa.com/t/if-else-but-button-dont-appear-back/307503 "2010-04-05T01:50:55Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ana81](https://avatars.discourse-cdn.com/v4/letter/a/c4cdca/32.png) [@Ana81](https://forum.kirupa.com/u/Ana81)\
**Post date:** [April 5, 2010, 1:50am UTC](https://forum.kirupa.com/t/if-else-but-button-dont-appear-back/307503/1 "2010-04-05T01:50:55Z")

</div>

Hi everyone,

I would very much appreciate if someone can help me with this or give me any tips: button is not coming back when it’s supposed to.

I am building a simple image galery. I have all my images side to side on a pictures\_mc, a forward and backward button.

The buttons work with an as3 that moves the mc accordingly

forward\_btn.addEventListener(MouseEvent.CLICK, function(){  
limits()  
new Tween (pictures\_mc,“x”,Strong.easeOut,pictures\_mc.x, pictures\_mc.x - 500, 1.5, true) })

I want the backward button to desapear when it’s the first picture and the forward when it’s the last. So I tried if and else:

function limits(){  
if(pictures\_mc.x \>= 400){  
forward\_btn.visible=false  
}else{  
forward\_btn.visible=true  
}  
}

The if is working and the button desapear, but the button does not appear back at least for a few pictures/clicks.

How can I fix this???

Thanks you so much
