# Can buttons work within a movie clip on a stage?

**URL:** <https://forum.kirupa.com/t/can-buttons-work-within-a-movie-clip-on-a-stage/19596>\
**Category:** flash\
**Created:** [April 29, 2003, 7:12pm UTC](https://forum.kirupa.com/t/can-buttons-work-within-a-movie-clip-on-a-stage/19596 "2003-04-29T19:12:04Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![anchorball](https://avatars.discourse-cdn.com/v4/letter/a/85f322/32.png) [@anchorball](https://forum.kirupa.com/u/anchorball)\
**Post date:** [April 29, 2003, 7:12pm UTC](https://forum.kirupa.com/t/can-buttons-work-within-a-movie-clip-on-a-stage/19596/1 "2003-04-29T19:12:04Z")

</div>

I have created an infinite menu applying the following code to a movieclip of grouped buttons called scrollclip:  
onClipEvent(load){  
\_\_\_\_this.SPEED\_MAX = 20;

\_\_\_\_this.tileOnStage = function(){  
\_\_\_\_\_\_\_\_this.dupe = this.duplicateMovieClip(“scrollDupe”, 2);  
\_\_\_\_\_\_\_\_if(this.\_y \> 0){ // If there’s blank space at the top of the stage  
\_\_\_\_\_\_\_\_\_\_\_\_this.dupe.\_y = this.\_y - this.\_height; //put the duplicate over the original  
\_\_\_\_\_\_\_\_}  
\_\_\_\_\_\_\_\_else if(this.\_y \< Stage.height - this.\_height){ // If there’s blank space at the bottom.  
\_\_\_\_\_\_\_\_\_\_\_\_this.dupe.\_y = this.\_y + this.\_height; //put the duplicate below the original  
\_\_\_\_\_\_\_\_}  
\_\_\_\_}  
}

onClipEvent(enterFrame){  
\_\_\_\_//If the mouse is over this menu (or it’s duplicate), find the distance from the center  
\_\_\_\_//of the stage to the mouse, and adjust the position accordingly  
\_\_\_\_if(this.hitTest(\_root.\_xmouse, \_root.\_ymouse, true) || this.dupe.hitTest(\_root.\_xmouse, \_root.\_ymouse, true)){  
\_\_\_\_\_\_\_\_var distFromMiddle = (\_root.\_ymouse - (Stage.height/2)) / (Stage.height/2); // results in a number from -1 to 1  
\_\_\_\_\_\_\_\_this.\_y += -1_this.SPEED\_MAX_distFromMiddle;  
\_\_\_\_}  
\_\_\_\_else{  
\_\_\_\_\_\_\_\_this.\_y -= this.SPEED\_MAX/2; // scroll up at half speed on its own  
\_\_\_\_}

\_\_\_\_if(this.\_y \< -1\*this.\_height){ //If MC has gone completely offstage  
\_\_\_\_\_\_\_\_this.\_y = 0; //move to the bottom of the stage  
\_\_\_\_}  
\_\_\_\_else if(this.\_y \> Stage.height){  
\_\_\_\_\_\_\_\_this.\_y = Stage.height-this.\_height;  
\_\_\_\_}  
\_\_\_\_this.tileOnStage();  
}

* * *

Now I am trying to link the buttons contained in the scrollclip movie each to new frames in a different scene.  
I am unable to apply the link action in the instance on the stage because the instance on the stage is a movie clip. When I apply the link action to a button in the movie clip it doesn’t work. I was thinking of apllying this via \_root…  
Does anyone know how to do this or link from a button within a movie clip?
