Google
 
Webnews.only-4-geeks.com
Interesting places
news.only-4-geeks.com Forum Index » Flash - ActionScript

Snapping SLider

 
Jump to:  
 
clacfre
PostPosted: 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();
}
 

 
kglad
PostPosted: Sat Jun 28, 2008 2:55 am    Post subject: Re: Snapping SLider
       
is perc defined when you calculate your _x property? and you should be using this.perc when you're in the scope of handle.
 

Page 1 of 1 .:.

Google
 
Webnews.only-4-geeks.com

Windows Update | C++ | C | PHP | JavaScript | Photoshop | Programming | Windows 2000 | Python | Windows XP | Object | Flash | Flash - ActionScript | Paint Shop Pro | Excel | PowerPoint | Access | Word | Windows 98 | Internet Explorer 6.0 | CorelDraw12 | Java | XML | asm x86 | Linux Mandrake | Linux RedHat | Outlook |  | news from newsgroups |_ | s

Web Templates

Awesome Website Templates ©

Yahoo Zarabianie sztaplarki Dieta KawaƂy