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 6092219
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T12:25:02+00:00 2026-05-23T12:25:02+00:00

In CSS, we have a box model to define how border, margin, padding, and

  • 0

In CSS, we have a box model to define how border, margin, padding, and fill contribute to the total width and height of a rectangle. I’m porting some of my HTML/CSS design into Flash and can’t quite figure out what Flash’s box model is. In Flash, I’ve created a rectangle with gradient fill and a non-scaling 1 pixel stroke. I’m trying to get pixel-perfect positioning and sizing, but the experience has been unpredictable. I’m not really seeing a pattern to the following questions. The answer really changes depending on the exact circumstances.

  1. When you set x and y both to be 0, where does the border lay? Is it off the screen? Is it being cut in half by the origin? Or is it completely visible?
  2. When you set width to 100, is the fill 98 wide or 100 wide?
  3. What happens to the 1px thick border when the rectangle is not positioned at whole number coordinates?

Example:

var sh:Shape = new Shape();
sh.graphics.lineStyle(1.0, 0x00FF00, 1.0, false, LineScaleMode.NONE);
sh.graphics.beginFill(0xFF0000, 1.0);
sh.graphics.drawRect(0, 0, 100, 100);
sh.graphics.endFill();
addChild(sh);
sh.x = 10;
sh.y = 10;

I tried to create a 100×100 square at x:10, y:10. When I measured the total width and height in Photoshop, it came out to be 101×101. Strange! One would either expect the final dimensions to be 100×100 (border on inside) or 102×102 (border on outside).

enter image description here

  • 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-05-23T12:25:03+00:00Added an answer on May 23, 2026 at 12:25 pm

    Strokes in Flash display objects lie along the edges of their fills. This is such that half the stroke lies outside the fill; the other half lies within the fill. This is unlike borders in CSS which lie entirely outside of the content area.

    This is best illustrated with an object situated against the stage, that has a solid fill and a semitransparent stroke. In the picture below, the rectangle is 200 by 200 pixels with a 10-pixel stroke. The fill is #00FFFF at 100% alpha and the stroke is #FF0000 at 50% alpha. Notice how the 5-pixel-thick area outside the stroke is blended with the stage color, while the 5-pixel-thick area inside it is blended with the fill color. The total width of each side measured in Photoshop is thus 210 pixels (5 + 200 + 5).

    So, to answer your questions…

    1. When you set x and y both to be 0, where does the border lay? Is it off the screen? Is it being cut in half by the origin? Or is it completely visible?

      Half of the top and left strokes will be visible within the object. The other half will be cut off by the stage edges.

    2. When you set width to 100, is the fill 98 wide or 100 wide?

      The fill is 100 pixels wide. While half of the rectangle’s width on each side is occupied by the stroke, the stroke doesn’t actually take up space or clip the fill; you just don’t see the area of the fill that’s behind the stroke (see above illustration).

    3. What happens to the 1px thick border when the rectangle is not positioned at whole number coordinates?

      If stroke hinting isn’t enabled for that stroke, it will be drawn anti-aliased or blurred. If stroke hinting is on, the stroke will be drawn as sharply as possible (while still maintaining enough anti-aliasing).

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

Sidebar

Related Questions

How many type of Box Model CSS have?
For text links, I have: CSS: a:link {color: #3366a9; text-decoration: none} a:hover {border-bottom: 1px
I have set ridiculous padding values and cannot get padding to extend the total
I have CSS rules on button input: button {border:solid 1px black;} As long as
I have the following.. <span class=error>@Model.ErrorMessage</span> The problem is that the css for error
I have a fairly far-out box model for my portfolio website. It's actually really
I have css that works on all tr tags for the table. so in
I have css hover over images for my tabs and I'm trying to get
in my CSS I have .footer a {color :red} .footer b {color :green} in
In amongst my CSS I have the following: #framecontentTop{ position: absolute; top: 0; left:

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.