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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T22:50:03+00:00 2026-05-14T22:50:03+00:00

I’m using a list element with variableRowHeight and word-wrap set to true like in

  • 0

I’m using a list element with variableRowHeight and word-wrap set to true like in the example below:

http://blog.flexexamples.com/2007/10/27/creating-multi-line-list-rows-with-variable-row-heights/

When I scroll through the list with a mouse scrollwheel the text in the listItems also scroll. I know that this is to do with the height of the textField… but I am unsure how to best resolve this issue. Any thoughts are appreciated!

The issue that I am experiencing also occurs in the example above.

  • 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-14T22:50:04+00:00Added an answer on May 14, 2026 at 10:50 pm

    OK, solved it after a bit of work. Thought I would put it here for others:

    This can be simply solved by extending the List element, and the ListItemRenderer and modifying a couple of lines:

    First up, extend the List element:

    package au.com.keeghan.controls {
        import mx.controls.List;
        import mx.core.ClassFactory;
    
        public class ExtendedList extends List{
            public function ExtendedList(){
                super();
    
                itemRenderer = new ClassFactory(ExtendedListItemRenderer);
            }
        }
    }
    

    Now we want to extend the newly created item renderer (ExtendedListItemRenderer). Because there isn’t actually that much code required, we can just put it in the same .as file. We do this by declaring it as a internal class, and locating it outside of the package above… just below the closing bracket:

    import mx.controls.listClasses.ListItemRenderer;
    
    internal class AsOneListItemRenderer extends ListItemRenderer{
    
        override protected function measure():void{
            super.measure();
    
            var w:Number = 0;
    
            if (icon)
                w = icon.measuredWidth;
    
            // Guarantee that label width isn't zero
            // because it messes up ability to measure.
            if (label.width < 4 || label.height < 4)
            {
                label.width = 4;
                label.height = 16;
            }
    
            if (isNaN(explicitWidth))
            {
                w += label.getExplicitOrMeasuredWidth();
                measuredWidth = w;
                measuredHeight = label.getExplicitOrMeasuredHeight();
            }
            else
            {
                measuredWidth = explicitWidth;
    
                label.setActualSize(Math.max(explicitWidth - w, 4), label.measuredHeight + 3);
                label.validateNow();
                label.height = label.textHeight + 5;
                measuredHeight = label.getExplicitOrMeasuredHeight() + 3;          
    
                if (icon && icon.measuredHeight > measuredHeight){
                    measuredHeight = icon.measuredHeight;
                }
            }
        }
    }
    

    Now, the majority of the above code is actually just copied from the ListItemRenderer, the magic occurs down the bottom… specifically these lines:

    label.setActualSize(Math.max(explicitWidth - w, 4), label.measuredHeight + 3);
    label.validateNow();
    label.height = label.textHeight + 5;
    measuredHeight = label.getExplicitOrMeasuredHeight() + 3;
    

    All I do here is add some height to both the label, and the overall measuredHeight which in the end is the thing that is causing this issue.

    The only downside to this solution is that you will get a larger amount of padding below the listItem element, however you can still make this look good by playing around with the verticalAlign and padding css properties.

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

Sidebar

Related Questions

No related questions found

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.