# Setting the starting point of a sliding menubar

**URL:** <https://forum.kirupa.com/t/setting-the-starting-point-of-a-sliding-menubar/183886>\
**Category:** Uncategorized\
**Created:** [March 30, 2006, 10:28pm UTC](https://forum.kirupa.com/t/setting-the-starting-point-of-a-sliding-menubar/183886 "2006-03-30T22:28:26Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dragline](https://avatars.discourse-cdn.com/v4/letter/d/edb3f5/32.png) [@dragline](https://forum.kirupa.com/u/dragline)\
**Post date:** [March 30, 2006, 10:28pm UTC](https://forum.kirupa.com/t/setting-the-starting-point-of-a-sliding-menubar/183886/1 "2006-03-30T22:28:26Z")

</div>

hi everyone\>

i’m building a site with a horizontal sliding menu not unlike the one shown in the “add thumbnails” tutorial. the one that i’m building involves a row of generated movieclips to be placed inside a parent called “displayarea”, and “displayarea” needs to line up starting at a point in the middle (for now, it’s hard-coded as the negative \_x value of a generated movieclip called “menu15” --see below).

my problem is: the way it’s displayed using the code below, when the user mouses out of the area that activates the scrolling, the movie clip “displayarea” always snaps back to the original \_x position.

how can i set the starting \_x position of “displayarea”, and tell the code to only use it as a starting point, and the scrolling will take over once the clip has loaded?

i’ve attached the swf so you can have a look at the problem.

\<–this code is attached to the first frame of the timeline that contains “displayarea”–\>

alignPoint = getProperty(displayarea.menu15, \_x);  
reelPos = displayarea.\_x;  
displayarea.\_x = -alignPoint;

if (\_ymouse\>-150) {  
if (\_ymouse\<0) {  
if (\_xmouse\<-400) {  
if (displayarea.hitTest (hitLeft)) {  
reelSpeed = (\_xmouse-center)/15;  
reelPos = Math.round (reelPos-reelSpeed);  
displayarea.\_x = reelPos;  
}  
}  
else if (\_xmouse\>400) {  
if (displayarea.hitTest (hitRight)) {  
reelSpeed = (\_xmouse-center)/15;  
reelPos = Math.round (reelPos-reelSpeed);  
displayarea.\_x = reelPos;  
}  
}   
}  
}

\<–end code–\>

thanks in advance for your help!
