Are your scrollbars not working in Flex?
In the Flex 3 SDK flex framework I found a minor little bug. When you set the "maxScrollPosition" on a scrollbar object, it doesn't actually change the scrollbar! Why? Well let's look at the code.
Found this in Program Files\Adobe\Flex Builder 3\sdks\3.0.0\frameworks\projects\framework\src\mx\controls\scrollClasses
/**
* @private
*/
public function set maxScrollPosition(value:Number):void
{
_maxScrollPosition = value;
}
What's missing here? Just one line of code, invalidateDisplayList(). This function tells the UI component that something has changed and it needs to be redrawn. There are a few ways to fix this. One, you can change the Flex SDK to fix the problem (but I don't recommend this). Two, you can extend the VScrollBar or HScrollBar components and override public function set maxScrollPosition to include it. And finally, just put myScrollBar.invalidateDisplayList() anytime you update the scrollbar in your application.

0 Comments:
Post a Comment
<< Home