# Codeing problem

**URL:** <https://forum.kirupa.com/t/codeing-problem/158059>\
**Category:** flash\
**Created:** [August 6, 2005, 3:59pm UTC](https://forum.kirupa.com/t/codeing-problem/158059 "2005-08-06T15:59:48Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ricardinho](https://avatars.discourse-cdn.com/v4/letter/r/278dde/32.png) [@Ricardinho](https://forum.kirupa.com/u/Ricardinho)\
**Post date:** [August 6, 2005, 3:59pm UTC](https://forum.kirupa.com/t/codeing-problem/158059/1 "2005-08-06T15:59:48Z")

</div>

ok another day another problem but its all part of the learing process… the file attached pretty much explains what is going wrong here… basically ive got a button on rollOver and rollOut sets x to = 1 or 2

on(rollOver){  
\_root.x = 1;  
}  
on(rollOut){  
\_root.x = 2;  
}

when x = 1 a movie is ment to trigger and the same as when x = 2 (the same movie)… trouble is x=2 works but x=1 doesn’t … the x = 1 code seems to acivate a gotoAndStop effect as apposed to the gotoAndPlay i should activate…

onClipEvent (enterFrame) {  
if(\_root.x==1) {  
this.gotoAndPlay(31);  
}  
if(\_root.x==2) {  
this.gotoAndPlay(1);  
}  
}

and i really cant understand y not… it should work in theory… check the attached example file to see more in depth whats going on…confusing…

thanks
