Skip to main content
Known Participant
June 14, 2009
Answered

Draggable button (drag without click)

  • June 14, 2009
  • 1 reply
  • 444 views

Can someone help to make a script for a draggable button? I just need a button (..onPress) that will wont work if you start dragging it

Thank you!

This topic has been closed for replies.
Correct answer kglad

lol.  that's confusing.  what is it that you want?   the button should or should not work when dragging?

1 reply

kglad
Community Expert
kgladCommunity ExpertCorrect answer
Community Expert
June 14, 2009

lol.  that's confusing.  what is it that you want?   the button should or should not work when dragging?

Known Participant
June 14, 2009

Oh yea i expressed wrong !! lol !!  But i found it! This was easy ... But I had other onpress for this button in the same actionframe and it wasnt working lol I leave it here for future searches.

I wanted the button to act only if you wont drag and just click it, not after drag it.

button.onPress=function(){

this.startDrag();
dragx = this._x
dragy = this._y
}

button.onRelease=function(){
this.stopDrag();
if (this._x == dragx || this._y == dragy){

// function

}

Sorry for that

kglad
Community Expert
Community Expert
June 14, 2009

np.