Author Topic: OnClick with a slider  (Read 3772 times)

DoctorWhy

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 35
    • View Profile
OnClick with a slider
« on: August 10, 2012, 12:45:38 PM »
I have an NGUI slider that I need to do something once the user lets go of the slider.  I have a script with the OnClick event in it.  I tried putting it on the slider itself, but OnClick is never called.  I then tried to put it on the thumb, and it is still never called.  Where does OnClick need to go, or what can I do to get OnClick (MouseUp event) to register on a slider?

PhilipC

  • Guest
Re: OnClick with a slider
« Reply #1 on: August 10, 2012, 01:03:35 PM »
If you only want to do something when the user lets go have you tried using OnPress and watching for when the pressed = false?

DoctorWhy

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 35
    • View Profile
Re: OnClick with a slider
« Reply #2 on: August 10, 2012, 01:16:25 PM »
That works!  Simple enough.  Thank you!  I don't really know why OnClick doesn't work, but oh well.

PhilipC

  • Guest
Re: OnClick with a slider
« Reply #3 on: August 10, 2012, 01:20:37 PM »
I tried it as well and am not 100% on that on but for your purposes of only need to know when they release OnPress works :).