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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T21:47:22+00:00 2026-05-24T21:47:22+00:00

In my Flex 4.5 mobile app, I have an actionScript item renderer (that derives

  • 0

In my Flex 4.5 mobile app, I have an actionScript item renderer (that derives from Flex’s LabelItemRenderer). I want to fit in exactly 2 lines of text, and then truncate the rest. The width and height of the label are fixed and known statically.

How can I do this? The StyleableTextField.truncateToFit() method only works for one line of text.

I’ve set wordWrap = true, so the text now flows into the second line – but I need to truncate the text if it doesn’t fit in two lines.

I need it to show all the text if there is only one line. (in both cases the label should be vertically middle-aligned in my renderer)

I know how to override layoutContents to do sizing and positioning etc of the StyleableTextField. So I’m looking specifically for ideas to implement custom text truncation with the StyleableTextField).

Any ideas?

  • 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-24T21:47:23+00:00Added an answer on May 24, 2026 at 9:47 pm

    Unless you’re using something specific to the StyleableTextField try the s:Label. It has a property maxDisplayedLines which you could set to 2 and it will handle the truncation.

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

Sidebar

Related Questions

I am building an mobile flex app in eclipse indigo and have my app
I am building a mobile application in Flex 4.5 and from this app I
I have a Pure AS3 mobile project that I'm developing in Flex 4.5, and
I am very new to flex and AS3. I want develop a mobile app
i want to create a chat app using flex 4.5 mobile project for android
I am running Flex mobile project and I would like my mobile app to
I am the freshman for flex and actionscript. I want to know when a
I'm working on a simple auto complete function for my Flex mobile app. For
I am creating a mobile app that will connect to a zendamf implementation to
I have a mobile Flex project which I am deploying to iPhone/iPod and Android.

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.