# Sliding Menu Control

**URL:** https://forum.kirupa.com/t/sliding-menu-control/78989
**Category:** flash
**Created:** [February 9, 2005, 5:55pm UTC](https://forum.kirupa.com/t/sliding-menu-control/78989 "2005-02-09T17:55:43Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![jfricher](https://avatars.discourse-cdn.com/v4/letter/j/f04885/32.png) [@jfricher](https://forum.kirupa.com/u/jfricher)
#### Post date: [February 9, 2005, 5:55pm UTC](https://forum.kirupa.com/t/sliding-menu-control/78989/1 "2005-02-09T17:55:43Z")

</div>

I’m hoping someone can help me. I am a newbie to flash and have found these threads very, very helpful. I almost have my project done, but would like to do one last tweak.

I created a sliding menu using the infinite menu tutorial, but I would like it to slide at a constant speed if the user moves outside the masked area. I tried the actionscript provided for the hit test, but cannot get it to work for my project, can you please help?

I have two layers on is a mask and the second is a filmstrip. The file is only 1 frame long. I cannot seam to integrate the actionscript from the controlling a sliding show thread into my movie. The following is the script that I have on my filmstrip.

onClipEvent (load) {  
xcenter = 393;  
speed = 1/50;  
}

onClipEvent (enterFrame) {  
var distance = \_root.\_xmouse-xcenter;  
\_x -= (distance\*speed);  
if (\_x\>0) {  
\_x = -1656;  
easeSpeed = 2  
}  
if (\_x\<-1656) {  
\_x = 0;  
easeSpeed = 2  
}  
if(\_root.mask.hitTest(\_root.\_xmouse,\_root.\_ymouse)) {  
\_x -=5;  
}   
}

Thanks again for any help.
