# If/else script in MX - help!

**URL:** <https://forum.kirupa.com/t/if-else-script-in-mx-help/160677>\
**Category:** Uncategorized\
**Created:** [August 28, 2005, 11:52am UTC](https://forum.kirupa.com/t/if-else-script-in-mx-help/160677 "2005-08-28T11:52:43Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![tikwik](https://avatars.discourse-cdn.com/v4/letter/t/b487fb/32.png) [@tikwik](https://forum.kirupa.com/u/tikwik)\
**Post date:** [August 28, 2005, 11:52am UTC](https://forum.kirupa.com/t/if-else-script-in-mx-help/160677/1 "2005-08-28T11:52:43Z")

</div>

my if/else statement doesn’t really work. Well, it does for the first part, but then the second part doesn’t. Is there any obvious reason?

on (release) {  
if (\_root.container.slider.trig.xposnew = -(\_root.container.slider.imagewidth)) {  
\_root.container.slider.trig.xposnew = -((\_root.container.slider.imagewidth)\*2) - 19;  
setProperty("\_root.container.slider.M1", \_visible, 0);  
} else {  
if (\_root.container.slider.trig.xposnew = -((\_root.container.slider.imagewidth)\*2) - 19) {  
\_root.container.slider.trig.xposnew = -(\_root.container.slider.imagewidth);  
setProperty("\_root.container.slider.M1", \_visible, 0);  
}  
}  
}

It is attached to a button which is supposed to comtrol a slideshow - if the first image is showing, then the button should slide in the second image. if the second image is showing (the -19 image), then the first should slide back in…
