# Double Click MC?

**URL:** <https://forum.kirupa.com/t/double-click-mc/245359>\
**Category:** Uncategorized\
**Created:** [November 28, 2007, 9:02pm UTC](https://forum.kirupa.com/t/double-click-mc/245359 "2007-11-28T21:02:09Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![paulcybulski](https://avatars.discourse-cdn.com/v4/letter/p/90db22/32.png) [@paulcybulski](https://forum.kirupa.com/u/paulcybulski)\
**Post date:** [November 28, 2007, 9:02pm UTC](https://forum.kirupa.com/t/double-click-mc/245359/1 "2007-11-28T21:02:09Z")

</div>

I am trying to create a function where if a user double clicks on a particular mc the mc will reset itself to its original zoom and position…however, I cannot get this feature to work correctly…when I do get the feature to work, I cannot drag and pan the mc…if the feature is disabled, I can drag and pan the mc…here is the code I came up with to double click reset the mc…but it does not work…can someone help?

[AS]  
\_root.click = false;  
\_global.CAD.onPress = function() {  
if (!click) {  
timer = getTimer()/1000;  
\_root.click = true;  
}  
else {  
timer2 = getTimer()/1000;  
if ((timer2-timer)\<.25) {  
\_global.zoom.\_xscale = \_global.zoom.\_yscale = mc\_scale;  
\_global.container.\_x = mc\_X;  
\_global.container.\_y = mc\_Y;  
} else {  
timer = getTimer()/1000;  
\_root.click = true;  
}  
}  
}

\_global.CAD.onRelease = function() {  
delete \_global.CAD.onPress;  
delete \_global.CAD.onRelease;  
delete \_global.CAD.onReleaseOutside;  
}  
[/AS]
