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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T22:29:58+00:00 2026-05-10T22:29:58+00:00

I have a list control where i want to show a string (thats fine)

  • 0

I have a list control where i want to show a string (thats fine) but a colored square as well.

Imagine i have a ‘add player’ button a text input with a color picker. I want to see the color + player name in the List. How could i do this ?

[Bindable] public var data:ArrayCollection = new ArrayCollection();     <mx:List id='eqlist' width='100%' dataProvider='{data}' />    data.addItem(fooTxt.text); 

This code will only add the text value, should i add a hbox object composed of a colored canvas + text value ?

Thanks,

  • 1 1 Answer
  • 1 View
  • 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. 2026-05-10T22:29:59+00:00Added an answer on May 10, 2026 at 10:29 pm

    You have to work with List itemRenderers. Basically List item renderer (ListItemRenderer) doesn’t support a different backgound color per item (backgound color can only be set on List parent).

    Example (MXML version – not my favorite way but the simpliest):

    Data provider initialization:

                var anObject: Object = new Object();             anObject.label = 'my player';             anObject.backgroundColor = 0xFF0000;             anObject.color = 0xFFFFFF;             aData.addItem(anObject);              anObject = new Object();             anObject.label = 'my player 2';             anObject.backgroundColor = 0x0000FF;             anObject.color = 0xAAAAAA;             aData.addItem(anObject); 

    List display:

        <mx:List id='eqlist' width='100%' dataProvider='{aData}' >         <mx:itemRenderer>             <mx:Component>                 <mx:Canvas backgroundColor='{data.backgroundColor}'                     color='{data.color}'>                     <mx:Label text='{data.label}'>                      </mx:Label>                 </mx:Canvas>             </mx:Component>         </mx:itemRenderer>     </mx:List> 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to show multiple columns in the list box. I have referred the
I have a data class that I want to show in a list on
I want to dynamically add items to a class, but someone may have to
I have a List<String> in a custom user control. Whenever the List<String> is modified,
I have a list box control that contains enough items to list them with
I have the list box control (ASP.NET Control On aspx page, language C# ).
Hello i have a list view control, While the form is being loaded i
I have an owner-drawn list control in my Windows program. I use CListCtrl::GetBkColor to
I have a radio button list control on my ascx page and have a
I have created a project in Dashcode, inserted a List control, enabled a dynamic

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.