| | | clacfre |  |
| Posted: Sat Jun 28, 2008 2:18 am Post subject: Snapping SLider |  |
I'm trying to make a slider that snaps to specific points, but still moves smoothly, so I added a onRelease function to the slider button. Can someone check out my code and tell me what's wrong with is? I'm kinda a flash noob, so sorry if there is a glaring mistake.
handle.onRelease=function(){ this._x = Math.round(Math.round(7*handle.perc/100)*100/7); //This calculates the nearest snapping position. perc=Math.round(this._x*100/rail._width); this.stopDrag(); } |
|