I've been searching for what attributes like scaleGridLeft and scaleGridRight actually mean, but cannot find a coherent explanation anywhere. One description said that if you have an image, what you're trying to do is to define a rectangle that will be UNaffected by scaling, within that image. The below code is for a custom skin for a Vertical Scroll Bar Thumb. I've set 'right' to -1 because the thumb otherwise leaves too big of a gap on its right side when it sits in the track.
If the scrollThumb.png is 10x331 and the track is 16x521, how do I make it so that the thumb sits correctly centered in the track, and scales as necessary?
<?xml version="1.0" encoding="utf-8"?>
<!--- The default skin class for the Spark Button component.
@see spark.components.Button
@langversion 3.0
@playerversion Flash 10
@playerversion AIR 1.5
@productversion Flex 4
-->
<fx:Metadata>
<![CDATA[
/**
* @copy spark.skins.spark.ApplicationSkin#hostComponent
*/
[HostComponent("spark.components.Button")]
]]>
</fx:Metadata>
<!-- states -->
<s:states>
<s:State name="up" />
<s:State name="over" />
<s:State name="down" />
<s:State name="disabled" />
</s:states>
<s:BitmapImage source="@Embed('assets/scrollThumb.png', scaleGridLeft='2', scaleGridTop='20', scaleGridRight='11', scaleGridBottom='50')"
left="0" top="0" bottom="0" right="-1" />
</s:SparkButtonSkin>