# Minimize a click-drag menu

**URL:** <https://forum.kirupa.com/t/minimize-a-click-drag-menu/156401>\
**Category:** flash\
**Created:** [July 25, 2005, 4:46pm UTC](https://forum.kirupa.com/t/minimize-a-click-drag-menu/156401 "2005-07-25T16:46:53Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jef](https://avatars.discourse-cdn.com/v4/letter/j/e5b9ba/32.png) [@jef](https://forum.kirupa.com/u/jef)\
**Post date:** [July 25, 2005, 4:46pm UTC](https://forum.kirupa.com/t/minimize-a-click-drag-menu/156401/1 "2005-07-25T16:46:53Z")

</div>

experimenting with a click drag menu for navigating a site. however this menu sometimes gets in the way of text so i was thinking of adding a minimise function so it pops to, lets say, top right of the screen, no matter where the minimise function is called.

i’m pretty new at actionscript so i can only give pseudo-code as a rough guide to what the minimise function will do.

1)onclick, note the x and y coordinates of menu (this is where i need help, how can you ask for the x-y coordinate and create variables from them?)  
2)apply x and y coordinate to formula to have it “slide” into place  
3)scale down respectively until about 10% of original size / replace with “restore” button

btw, i have a sample code i have been staring at for a while (i didn’t write it, would it come in useful?)

onClipEvent(load){  
this.\_x = -100;  
endPosx = 850;}  
onClipEvent(enterFrame){  
currentPosx = this.\_x;  
diffPosx = endPosx - currentPosx;  
movex = diffposx/3.5;  
this.\_x = this.\_x+movex;}

Thanks!
