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

  • SEARCH
  • Home
  • 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 776665
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T19:29:06+00:00 2026-05-14T19:29:06+00:00

when I check the width of my objects I always get 0. Here is

  • 0

when I check the width of my objects I always get 0. Here is an example:

newTag = new LinkButton();
newTag.label = dataManager.tagViewTimelineModel.tags.getItemAt(i).name;
newTag.setStyle("color","#FFA500");
newTag.setStyle("rollOverColor","#FFA500");
newTag.setStyle("selectionColor","#CCCCCC");
newTag.toolTip ="Unselect tag";
newTag.setStyle("fontSize",16); 

Alert.show(newTag.width); //This is 0

I guess because width is a property I can set, but it is not automatically computed by Flex. How can I know how big are my objects (as conseguence of the included text ?)

thanks

  • 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-14T19:29:06+00:00Added an answer on May 14, 2026 at 7:29 pm

    The sizing and positioning of a component is always set by that component’s parent. In your code you have not yet added the LinkButton to a container, and therefore it will not yet have a size. Width and Height will always be zero in such a case.

    Once you add it as a child to a parent, it will start through the component lifecycle. It will call mesaure() will define it’s measuredHeight and measuredWidth values. It is up to the parent to decide whether to use the measuredHeight or measuredwidth or not. This is usually done in updateDisplayList().

    If you’re using a default Flex container, it probably already has methods to size it’s children; and you only have to worry about adding it as a child.

    However, keep in mind the lifecycle has to run before it will have width or height. You can’t addChild and immediately expect non-zero values.

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

Sidebar

Related Questions

Normally when you have a div created in html. You can check its width
Check this code : HTML : <div style="position: absolute; visibility: visible; width: 172px;"> <img
Here's what I've done so far: In my App class, I declare a new
There's is something I don't get with ASP objects. I have a button in
How can I check with Java if a program is installed on a Windows
How can I check with C# if the IIS6 compatibility role is enabled/disabled on
Can I check with jQuery whether the User increased the font size and bind
is it possible to check (with PHP) if the browser supports SVG? like ...
How to check with JS if flash is installed, or not? I don't want
Can I check with you guys if I wanna create an app that can

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.