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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T19:15:51+00:00 2026-05-11T19:15:51+00:00

I am feeding the label to my LinkButton directly from a string I receive

  • 0

I am feeding the label to my LinkButton directly from a string I receive from a Google API that puts html to format the label.

I want to extend linkbutton to allow this. I wrote a class myself to allow html text for the label and that aspect of it works but now the background that appears when you hover is way too big. I tried to override measure() to fix this but I didn’t have a clue how. Here is the class I wrote:

package com.kranichs.components
{
    import mx.controls.LinkButton;

    public class HTMLLinkButton extends LinkButton
    {
        protected var _isHTML:Boolean;

        public function HTMLLinkButton()
        {
            super();
        }

        [Bindable]
        public function set isHTML(value:Boolean):void
        {
            _isHTML = value;
        }
        public function get isHTML():Boolean
        {
            return _isHTML;
        }

        override protected function updateDisplayList(unscaledWidth:Number,
                                                  unscaledHeight:Number):void
        {
            super.updateDisplayList(unscaledWidth, unscaledHeight);
            if(_isHTML)
            {
                textField.htmlText = label;
            }
        }



    }
}
  • 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-11T19:15:51+00:00Added an answer on May 11, 2026 at 7:15 pm

    the measure() function is the key.

    Assuming you are using a flex compatibility version >= 3.0, the key line is in Button.measure():

    var lineMetrics:TextLineMetrics = measureText(label);
    

    You need to change this to something like:

    var lineMetrics:TextLineMetrics = _isHTML ? measureHTMLText(label) : measureText(label);
    

    You will probably need to copy the measure function from button into your class and make this change.

    If you do that, you will most likley need to import the internal namespace, like this:

    import mx.core.mx_internal;
    
    use namespace mx_internal;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Introduction In my current organisation, we have many desktop and web applications all feeding
I have the feeling that is easy to find samples, tutorials and simple examples
I got this bad feeling about how I insert larger amounts of HTML. Lets
I have a feeling that I already know the answer to this one, but
I have a feeling that there must be client-server synchronization patterns out there. But
I have the feeling that Flash -based ( or Silverlight -based) websites are generally
I want all labels inside a detail view to be bold. I created a
I have some sprites that the users can manipulate, drag around and resize. Now
I have to set the label text of a load of differnet labels on
I have an NSString which I need to 'clean' before feeding it into my

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.