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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T18:12:53+00:00 2026-05-11T18:12:53+00:00

I want to make a label that has a tiny title above it, for

  • 0

I want to make a label that has a tiny title above it, for example so the label say $1,000 with a small retail price or our price above it. I am trying to add the title label to the display list of the main label. I get no error but the title does not show up. I also considered rawChildren but apparently Label has no rawChildren property.

Here is my code:

package
{
    import mx.controls.Label;

    public class PriceLabel extends StrikeThroughLabel //<-- exntension of label to add strike
    {
        private var _title:Label;

        public function PriceLabel()
        {
            super();
        }

        [Bindable]
        public function set title(s:String):void
        {
            if(_title == null)
            {
                _title = new Label();
                addChild(_title);
                this.alpha = .2;
            }
            _title.text = s;
        }
        public function get title():String
        {
            var s:String
            if(_title != null)
            {
                s = _title.text;
            }
            return s;
        }

    }
}
  • 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-11T18:12:53+00:00Added an answer on May 11, 2026 at 6:12 pm

    If you add children to a Flex component that is not a container, then you have to manually manage sizing and positioning of those children. Containers do a lot of that work for you.

    Here’s what you should do:

    1. Move the creation of your child Label into an override of the createChildren() function.

    2. Set the text property of the child label in an override of the commitProperties() function. Your title getter and setter should save the value in a _title variable to be used later for the assignment in commitProperties(). This is actually important for performance.

    3. Override the measure() function and update measuredWidth and measuredHeight to be the maximum width and height values of the main label and it’s child.

    4. Override updateDisplayList() and use setActualSize() on the child Label to set it to the required width and height.

    That may seem like a lot of work, but in terms of best practices, that’s the way you’re supposed to build custom components. The Flex Team at Adobe spent a lot of time maximizing performance, and that’s why things happen in several steps like that.

    That’s how to do it based on what you asked. Personally, I would make a subclass of UIComponent with two Labels or UITextFields as children, each with their own separate property.

    By the way, the rawChildren property is only available on containers. It exists so that you can add “chrome” to a container that isn’t part of the container’s child layout algorithm. For example, Panel has a title bar and a border that aren’t affected by the vertical/horizontal/absolute layout options.

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

Sidebar

Ask A Question

Stats

  • Questions 146k
  • Answers 146k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Check out Django smart-if template tag http://simonwillison.net/2009/Mar/3/smartif/ http://www.djangosnippets.org/snippets/1350/ It replaces… May 12, 2026 at 9:02 am
  • Editorial Team
    Editorial Team added an answer No, you can never access any information that has SecurityCriticalAttribute,… May 12, 2026 at 9:02 am
  • Editorial Team
    Editorial Team added an answer I don't know which errors you've got but I when… May 12, 2026 at 9:02 am

Related Questions

I am trying to make a label that has an X over it. Like
I have a listview with a DataTemplate that has a ComboBox. I want the
I am building ASP.NET 2.0 websites and currently I some home grown assemblies for
(WinForms .net 2.0) I'm making a form which, much like the standard MessageBox ,

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.