Upon skinning a Flex ScrollBar recently, using symbols from an external assets SWF, I came across a bit of a conundrum: Flex appeared to be resizing the skins to almost half their size. "Why can this be?", I thought. Quickly rummaging around Google and the Flex lists, I found that a few poor souls were having the same issue.
Whilst rooting around the ScrollBar source, it turned out there is a THICKNESS constant defined. A bit more sifting uncovered the fact it wasn't referenced anywhere: ScrollBar, VScrollBar, Canvas; nowhere. Until I found its one lonely existence: mx.skins.halo.ScrollArrowSkin - in its measuredWidth and measuredHeight getters.
It seems that, if you define less than the four - up, down, over, disabled - skins, at least one will be using the above Halo class, meaning all will be reskinned to the magic 16 defined in THICKNESS. Defining the remaining of these four states corrects the problem; in my case, just the disabled.
Magic; or so it seems.
Hi man, I'm having the same problem in a canvas. Can you please publish the code?. (css) Thanks.
ReplyDelete