Disable bounce and pull effects on Flex Scroller component

Today I stumbled on a problem with Flex Spark Scroller and List components while developing an AIR mobile application.

Scroller component has a nice bounce effect when you pull it and it works the same way as you’ll expect the scrolling to work on iPhone (read here).

You don’t always need this behavior, and for some reason you can’t disable this effect. Another problem is that all the possible properties and methods on the Scroller class, which might allow you to change this functionality are eighter private or protected.

The only possible way to go is extending the Scroller class and disabling this effect manually in your class.

Here is a class I’ve created which does exactly thiscom.avladov.components.Scroller

In order to disable the viewport dimensions overshooting just set overhsootEnabled value to false when you use the component.

Bouncing is diabled through overriding of performDrag and performThrow methods and resetting required values when needed.

If you have a better idea, feel free to share it 😉

Leave a Reply