# My onRollover, onRollOut & onPress problem

**URL:** <https://forum.kirupa.com/t/my-onrollover-onrollout-onpress-problem/316457>\
**Category:** Uncategorized\
**Created:** [November 22, 2010, 2:46pm UTC](https://forum.kirupa.com/t/my-onrollover-onrollout-onpress-problem/316457 "2010-11-22T14:46:47Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![pinedoor](https://avatars.discourse-cdn.com/v4/letter/p/71c47a/32.png) [@pinedoor](https://forum.kirupa.com/u/pinedoor)\
**Post date:** [November 22, 2010, 2:46pm UTC](https://forum.kirupa.com/t/my-onrollover-onrollout-onpress-problem/316457/1 "2010-11-22T14:46:47Z")

</div>

Hi…

Am learning AS2 as I go, but have come across problem I cannot seem to resolve (am using Macromedia Flash Professional 8).

I’ve created three movieclips to select the next level, and these work fine the first time my game runs, but when I come back to them, after the first game is over and we’re restarting, the movieclips appear, but the onRollOver,onRollOut and onPress do not work…

I suspect this may be a comman problem but can’t seem to find a solution for me…any halp would be very gratefully accepted, as apart from this problem, I’m almost finished…

the frame in question is posted below…

attachMovie(“level1”,“level1”,\_root.getNextHighestDepth(), {\_x:100, \_y:100 });  
attachMovie(“level2”,“level2”,\_root.getNextHighestDepth(), {\_x:100, \_y:200 });  
attachMovie(“level3”,“level3”,\_root.getNextHighestDepth(), {\_x:100, \_y:300 });

level1.onRollOver = function() {  
music.start(0,0)}

level2.onRollOver = function() {  
music1.start(0,0)}

level3.onRollOver = function() {  
music2.start(0,0)}

level1.onRollOut = function() {  
music.stop()}

level2.onRollOut = function() {  
music1.stop()}

level3.onRollOut = function() {  
music2.stop()}

level1.onPress = function() {  
music.stop()  
music.start(0,9999)  
level1.removeMovieClip();  
level2.removeMovieClip();  
level3.removeMovieClip();  
lvl = 1  
gotoAndstop(“fr2”);

}  
level2.onPress = function() {  
music1.stop()  
music1.start(0,9999)

level1.removeMovieClip();  
level2.removeMovieClip();  
level3.removeMovieClip();  
lvl = 2  
gotoAndstop(“fr2”);}  
level3.onPress = function() {  
music2.stop()  
music2.start(0,9999)  
level1.removeMovieClip();  
level2.removeMovieClip();  
level3.removeMovieClip();  
lvl = 3  
gotoAndstop(“fr2”);}

stop()
