Double Click MC???

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • paulcybulski
    New Member
    • Nov 2007
    • 25

    Double Click MC???

    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]
  • rsdev
    New Member
    • Jul 2007
    • 149

    #2
    Try this;


    Code:
    on(release){
    	if(lastclick - (lastclick=getTimer()) + 500 > 0){
    			//do doubleclick action
    		 trace("double");
    	} else {
    			//do singleclick action
    		 trace("single");
    	}
    }
    Not my code, but works for me:)

    Comment

    Working...