Is there an easy way to replace the ScrollPane scrollbar with the OS’s native scrollbar?
Flash applications look much more integrated if they have the same skinning as the user’s operating system — which isn’t always easy to detect (Vista Aero vs. Classic?).
Have you guys come across any examples of Flash apps doing this?
For the curious, we separated the scrollpane component into a self-contained swf and placed a set of two nested divs along the right and bottom side of the widget.
Using the vertical scrollbar as an example, the outer div was set to the height of the scrollpane and had a CSS
overflow-xofhidden, and anoverflow-yofauto. The child div was then set to some arbitrary width and a height equal to the height in px of the scrollpane’s content.The browser would display an appropriately sized “scroll grip” and we could quickly read the vertical scroll offset on the outer div to know how far to offset the Flash scrollpane. The same technique, with appropriate modifications, was used for the horizontal scrollbar.
We also included some logic to auto-hide the containers based on their overflow. The result matched native OS behavior pretty closely.
While this may sound like a huge hack, we were able to widely deploy the solution (scribd.com) without any major issues.