# Make midpoint larger?

**URL:** <https://forum.kirupa.com/t/make-midpoint-larger/240832>\
**Category:** Uncategorized\
**Created:** [October 6, 2007, 11:22pm UTC](https://forum.kirupa.com/t/make-midpoint-larger/240832 "2007-10-06T23:22:32Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![charmed](https://avatars.discourse-cdn.com/v4/letter/c/ccd318/32.png) [@charmed](https://forum.kirupa.com/u/charmed)\
**Post date:** [October 6, 2007, 11:22pm UTC](https://forum.kirupa.com/t/make-midpoint-larger/240832/1 "2007-10-06T23:22:32Z")

</div>

[flash cs3 or 8?] Here is my script its a navigation. I want my midpoint larger so that the navigation will hold still as I roll over the three middle pics. instead of one measly little x point. Any thoughts would be greatly appreciated. (ps I am not talking about the hit state I am trying to figure out I think the midpoint.)  
Thanks Charmed!

stop();

hitStateXdiff = 125;  
hitStateYdiff = 40;  
speed = 85;  
space= 26;

hitStateWidth = myMask.\_width + hitStateXdiff;  
hitstateHeight = myMask.\_height + hitStateYdiff;  
menuXpos = myMask.\_x;  
menuYpos = myMask.\_y +((myMask.\_height - menu\_mc.\_height)/2);  
hitStateXpos = myMask.\_x - (hitStateXdiff/2);  
hitStateYpos = myMask.\_y - (hitStateYdiff/2);  
active = false;

hitState\_mc.\_width=hitStateWidth;  
hitState\_mc.\_height=hitStateHeight;  
hitState\_mc.\_x=hitStateXpos;  
hitState\_mc.\_y=hitStateYpos;

speed /= 100;

menu\_mc.\_y = menuYpos;  
menu2\_mc.\_y = menuYpos;

[COLOR=Black]:sleep:midPoint = (myMask.\_width/2) + menuXpos;[/COLOR]

menuWidth = menu\_mc.\_width + space;

menu\_mc.\_x = menuXpos;  
menu2\_mc.\_x = (menuXpos - menuWidth);

hitState\_mc.onMouseMove = function(){  
if(this.hitTest(\_root.\_xmouse, \_root.\_ymouse, true) && active == false){  
moveMenu();  
active = true;  
}else if (!this.hitTest(\_root.\_xmouse, \_root.\_ymouse, true) && active == true){  
delete menu\_mc.onEnterFrame;  
active = false;  
}  
}

function moveMenu() {  
menu\_mc.onEnterFrame = function() {  
if (\_root.\_xmouse != midPoint) {  
increment = Math.abs(\_root.\_xmouse-midPoint)\*(speed/10);  
if (\_root.\_xmouse\<midPoint) {  
if (menu\_mc.\_x\>menuXpos + hitStateWidth || menu2\_mc.\_x\>menuXpos + hitStateWidth) {  
if (menu\_mc.\_x\>menuXpos + hitStateWidth) {  
menu\_mc.\_x = (menu2\_mc.\_x-menuWidth);  
menu2order = “right”;  
} else {  
menu2\_mc.\_x = (menu\_mc.\_x-menuWidth);  
menu2order = “left”;  
}  
}else{  
menu\_mc.\_x += increment;  
}  
} else {  
if (menu\_mc.\_x\<(menuXpos-menuWidth) || menu2\_mc.\_x\<(menuXpos-menuWidth)) {  
if (menu\_mc.\_x\<(menuXpos-menuWidth)) {  
menu\_mc.\_x = (menu2\_mc.\_x+menuWidth);  
menu2order = “left”;  
} else {  
menu2\_mc.\_x = (menu\_mc.\_x+menuWidth);  
menu2order = “right”;  
}  
}else{  
menu\_mc.\_x -= increment;  
}  
}  
if(menu2order==“left”){  
menu2\_mc.\_x = menu\_mc.\_x - menuWidth;  
}else{  
menu2\_mc.\_x = menu\_mc.\_x + menuWidth;  
}  
}  
}
