# Problems with on(press) and on(rollOver)

**URL:** <https://forum.kirupa.com/t/problems-with-on-press-and-on-rollover/190742>\
**Category:** Uncategorized\
**Created:** [June 14, 2006, 12:52pm UTC](https://forum.kirupa.com/t/problems-with-on-press-and-on-rollover/190742 "2006-06-14T12:52:28Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sean\_McCormack](https://avatars.discourse-cdn.com/v4/letter/s/bb73d2/32.png) [@Sean\_McCormack](https://forum.kirupa.com/u/Sean_McCormack)\
**Post date:** [June 14, 2006, 12:52pm UTC](https://forum.kirupa.com/t/problems-with-on-press-and-on-rollover/190742/1 "2006-06-14T12:52:28Z")

</div>

hello all.  
i’m having a problem concerning the functions on(press) and on(rollOver).  
i have a movieclip (text.swf) that contains text (which is also a movieclip) that can be scrolled up and down with two buttons. the text movieclip has the following code:  
[COLOR=RoyalBlue][COLOR=Blue]onClipEvent (load) {  
oben = this.\_y;  
mask = 10;  
unten = -this.\_height+mask;  
speed = 20;  
\_parent.up = false;  
\_parent.dwn = false;  
}  
onClipEvent (enterFrame) {  
if (\_parent.up) {  
if (this.\_y\<oben) {  
this.\_y += speed;  
}  
}  
if (\_parent.dwn) {  
if (this.\_y\>unten) {  
this.\_y -= speed;  
}  
}  
}[/COLOR]

[COLOR=Black]and the down-button has the following script:  
[COLOR=Blue]on(press){  
dwn=true  
}  
on(release){  
dwn=false  
}

[COLOR=Black]and the same script lies on the up button but instead of dwn it says up.  
up to this point everything works fine when i preview the film.

now i would like to load this movieclip (text.swf) into another movieclip.  
[COLOR=Blue][COLOR=Black]this script is on the first frame:[/COLOR]  
loadMovie(“text.swf”, “\_root.container”);  
[COLOR=Black]  
as you can see the movieclip “text.swf” is beeing loaded into a movieclip with the instance name “container” even up to this point there are no problems and everything works the way it should. but now i would like to have the option that i can drag the “container”[/COLOR] [COLOR=Black]with my mouse, so i use the following code:[/COLOR]  
on (press) {  
startDrag("");  
drag=true;  
}  
on (release) {  
stopDrag();  
drag=false;  
}

[COLOR=Black]this is when i’m having problems. now i am able to drag around the container, containig the text.swf but the scroll buttons wont work, so i can’t scroll my text.[/COLOR]

anyone out there who can help me with this??  
i’d appreciate any help.  
thanks.  
[/COLOR]  
[/COLOR][/COLOR][/COLOR][/COLOR]
