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...howe ver, I cannot get this feature to work correctly...whe n 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.onP ress = function() {
if (!click) {
timer = getTimer()/1000;
_root.click = true;
}
else {
timer2 = getTimer()/1000;
if ((timer2-timer)<.25) {
_global.zoom._x scale = _global.zoom._y scale = mc_scale;
_global.contain er._x = mc_X;
_global.contain er._y = mc_Y;
} else {
timer = getTimer()/1000;
_root.click = true;
}
}
}
_global.CAD.onR elease = function() {
delete _global.CAD.onP ress;
delete _global.CAD.onR elease;
delete _global.CAD.onR eleaseOutside;
}
[/AS]
[AS]
_root.click = false;
_global.CAD.onP ress = function() {
if (!click) {
timer = getTimer()/1000;
_root.click = true;
}
else {
timer2 = getTimer()/1000;
if ((timer2-timer)<.25) {
_global.zoom._x scale = _global.zoom._y scale = mc_scale;
_global.contain er._x = mc_X;
_global.contain er._y = mc_Y;
} else {
timer = getTimer()/1000;
_root.click = true;
}
}
}
_global.CAD.onR elease = function() {
delete _global.CAD.onP ress;
delete _global.CAD.onR elease;
delete _global.CAD.onR eleaseOutside;
}
[/AS]
Comment