Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8128903
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T08:05:18+00:00 2026-06-06T08:05:18+00:00

I’ve been searching for what attributes like scaleGridLeft and scaleGridRight actually mean, but cannot

  • 0

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 10×331 and the track is 16×521, how do I make it so that the thumb sits correctly centered in the track, and scales as necessary?

Scroll Thumb enter image description here

<?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>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T08:05:21+00:00Added an answer on June 6, 2026 at 8:05 am

    The links provided by @wovencharlie are helpful, but the answer is not correct.

    The left, right, top, and bottom values are all calculated in relation to the registration point of whatever you’re trying to scale. This means the upper left corner is (0,0). What you’re defining with these values is the rectangle within which you don’t care if it scales. Put another way, what will not scale is what is outside that rectangle.

    If I set scaleGridLeft=’2′ this means that everything from 0 to 2 will not scale. If I set scaleGridTop=’5′, this means that everything that is visually above the y value of 5 (relative to that initial 0,0 registration point, so anything with a y values of less than 5) will not scale. If I set scaleGridRight=’12’, this doesn’t mean the number of pixels starting at the right moving in. It’s setting the number of pixels (12) from the initial registration point, creating the imaginary vertical line to the right of which the asset will not scale. Since my thumb asset is only 10 pixels wide, 12 is not a good value and leads to odd results (it seems to want to redraw a vertical mirror image of the thumb, extending outside the track). 9 would be a legal value.

    This is why if you enter scaleGridLeft number that is greater than a scaleGridRight number, Flash Builder will tell you that these are illegal values. They’re impossible — you can’t have a left value with a greater number than a right value, since they’re both calculated relative to that initial (0,0).

    The same is true for scaleGridBottom. It isn’t being calculated up from the bottom; it’s being calculated from 0,0. Again, you cannot have a bottom value that is less than a top value, so Flash Builder will complain if you try.

    If you set scaleGridTop to (say) 20 and scaleGridBottom to 30, you aren’t saying “Don’t scale the top 20 and the bottom 30.” You’re saying “Don’t scale the top 20 and don’t scale everything below 30” — even if your asset is 200 or 300 pixels high. In other words, all you’re allowing to scale is 10 pixels.

    I believe you may get an error since this is less than the allowable size of the component (though not sure about that part).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Seemingly simple, but I cannot find anything relevant on the web. What is the
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have a jquery bug and I've been looking for hours now, I can't
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
I would like to count the length of a string with PHP. The string
For some reason, after submitting a string like this Jack’s Spindle from a text
I've got a string that has curly quotes in it. I'd like to replace
I would like to run a str_replace or preg_replace which looks for certain words
I have a French site that I want to parse, but am running into

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.