LOADING
Loading
Hi , welcome back.
LogoutLOGOUT
 
  Lost password?  
Hi
 




 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 01-26-2006, 04:18 PM
dirk dirk is offline
Registered User
 
Join Date: Sep 2005
Posts: 50
Rep Power: 8
dirk is on a distinguished road
combine button double click with drag function

Hi

I'm trying to combine a mc button's drag functionality with a double click functionality.

I have the actionscript to do both - with the drag aspect working fine - but I'm having problems getting the double click to work too - basically meshing the respective scripts.

Tried variations on combining the scripts but nothing working so far - grateful for any help on getting this right.

The script is below

Thanx



//double click: set initial variables
click = false;

//function for the button press
this.onPress = function() {
//if this is the first click
if (!click) {
timer = getTimer()/1000;
_root.click = true;
}
else {
timer2 = getTimer()/1000;
//if it is a double click
if ((timer2-timer)<.25) {
//toggle the box mc on and off
if (this._visible==false) {
this._visible = true;
} else {
this._visible = false;
}
} else {
timer = getTimer()/1000;
_root.click = true;
}
}
};

on (press) {
//Start Dragging Movieclip Behavior
startDrag(this, false, 168, 224, 564, 476);
this.swapDepths(this._parent.getNextHighestDepth() );
n=this.getDepth();
_root.introBox.swapDepths(n+1);
//End Behavior


}
on (release,rollOut) {
stopDrag();

}
Reply With Quote
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
New button & Function (i think...) tweakfreak33 Apache Flex 1 01-03-2008 01:58 PM
adding an image to the toolTip class - help nasdaq404 Actionscript 2.0 9 12-06-2006 03:25 PM
Want to disable a button for double-click DenkouNova General Flash 1 05-01-2006 08:45 AM
Drag button to icon, to create a sound. wongpohseong Flash MX 2004 0 02-10-2006 10:49 PM
Making a button inside of a drag & drop-able object. brahill Flash MX 2004 1 03-21-2005 03:05 PM




All times are GMT. The time now is 08:26 PM.