I've seen a few people asking for the ability to have variable scrollbar widths in the Flash CS3 component set. Unfortunately, it wasn't something we were able to get in for the release, but since then I have put a bit of time into the feature, and believe I have it working satisfactorily with all components. I added two styles: scrollBarWidth and scrollArrowHeight. The former controls the width of the scroll bar (or height in a horizontal scroll bar), the latter controls the height of its arrows (allowing you to have irregularly sized arrows).
It's important to note that this modification has not seen comprehensive testing, and it is not connected with Adobe in any way. Any mistakes are my own, and I'd appreciate if you can let me know about them in the comments.
Here's a simple demo showing the global scrollBarWidth and scrollArrowHeight set to 10, TileList's scrollArrowHeight set to 25 (to create rectangular arrows), and the top instance of a scrollBar component set to 25/25 (requires Flash Player 9):
You can download the code package by clicking here. To use, simply copy the fl directory into your project directory (or your project class path). The modified classes will override the component classes that shipped with CS3. Note that it may slightly increase your compile time, as these classes are not pre-compiled.
I'd appreciate knowing if this is useful for people, as I plan to release more updates and feature additions if this is well received.
Also, if anyone is curious, I'm waiting to hear from Adobe on what the official word in the EULA is regarding distributing component code like this. In the interim, I have received special permission to distribute some of my own updates - note that it may not be legal to do so if you do not have this permission. I will post about the details as soon as I have them.
Comments (10)
This looks great... sadly the link is broken.
Posted by: Dan at May 30, 2007 11:22 AMURL:
Thanks for letting me know. It's fixed now (darn case sensitive URLs).
Posted by: Grant Skinner at May 30, 2007 11:24 AMURL: http://gskinner.com/
It's great ! along with the scrollbar skinning it is extremely usefull.
Thank you,
Posted by: Maz at July 2, 2007 02:20 AMURL: http://www.bubble-mind.com
Nice. Should be official.
Posted by: Intoxopox at July 3, 2007 09:48 AMURL: http://professorfripples.com/blog
Hi,
Posted by: Yasha Rozov at August 15, 2007 05:48 AMis there anyway to use this with actionscript 2.0?
URL:
This is *very* useful. Thanks! I love the fact that the source is included in the CS3 components so you can modify if required.
Posted by: felix at August 30, 2007 05:26 PMURL: http://www.airtightinteractive.com
how about scrollThumbHeight?
Posted by: damo at October 14, 2007 12:38 AMURL:
damo,
Not so cool as using styles, but you can comment line 993:
//thumb.height = Math.max(13,_pageSize / per * track.height);
on updateThumb method to avoid thumb vertical resizing.
Posted by: Saulo at October 24, 2007 02:10 PMURL: http://www.weka.com.br
I've attached a scrollbar to a text field in my fla. Works fine when I publish it but when I upload the swf to my server it becomes invisible. It still works you just can't see it. Has anyone run into this?
Posted by: jwerre at March 26, 2008 04:18 PMURL:
Tnx man, it works great!
Posted by: cloetensbrecht at May 30, 2008 10:31 AMURL: http://www.cloetensbrecht.be