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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T01:02:45+00:00 2026-05-20T01:02:45+00:00

This seems like it should be really simple, but I’m a total newbie to

  • 0

This seems like it should be really simple, but I’m a total newbie to Flex and am getting stuck.

Here’s what I have right now, which works:

<s:List id="list"
        itemRenderer="spark.skins.spark.DefaultComplexItemRenderer"
        horizontalCenter="0"
        verticalCenter="0">
    <s:layout>
        <s:TileLayout requestedColumnCount="3"
                      requestedRowCount="2"
                      horizontalGap="0"
                      verticalGap="0" />
    </s:layout>
    <s:dataProvider>
        <s:ArrayList>
            <s:BitmapImage source="@Embed('../images/menus/car_types/truck.png')" />
            <s:BitmapImage source="@Embed('../images/menus/car_types/suv.png')" />
            <s:BitmapImage source="@Embed('../images/menus/car_types/convertible.png')" />
            <s:BitmapImage source="@Embed('../images/menus/car_types/sedan.png')" />
            <s:BitmapImage source="@Embed('../images/menus/car_types/surprise.png')" />
        </s:ArrayList>
    </s:dataProvider>
</s:List>

What I’d like to do is add labels below each tile, associating each image with a string. I want to do something like

<s:List id="list"
        itemRenderer="spark.skins.spark.DefaultComplexItemRenderer"
        horizontalCenter="0"
        verticalCenter="0">
    <s:layout>
        <s:TileLayout requestedColumnCount="3"
                      requestedRowCount="2"
                      horizontalGap="0"
                      verticalGap="0" />
    </s:layout>
    <s:dataProvider>
        <s:ArrayList>
            <s:BitmapImage name="Truck" source="@Embed('../images/menus/car_types/truck.png')" />
            <s:BitmapImage name="SUV" source="@Embed('../images/menus/car_types/suv.png')" />
            <s:BitmapImage name="Convertible" source="@Embed('../images/menus/car_types/convertible.png')" />
            <s:BitmapImage name="Sedan" source="@Embed('../images/menus/car_types/sedan.png')" />
            <s:BitmapImage name="Surprise Me!" source="@Embed('../images/menus/car_types/surprise.png')" />
        </s:ArrayList>
    </s:dataProvider>
</s:List>

but since there is no name property on the BitmapImage object, I get errors.

I guess I need to put each BitmapImage in an Object and also put in a string as a property of the object, but I can’t figure out how to do this. This is my best guess, but then I don’t know how to specify the property name for the BitmapImage:

<fx:Object label="Truck">
    <s:BitmapImage source="@Embed('../images/menus/car_types/truck.png')" />
</fx:Object>

After that, I guess I would make a custom ItemRenderer to read out the properties on each object?

TIA

  • 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-20T01:02:45+00:00Added an answer on May 20, 2026 at 1:02 am

    I think you are mixing your metaphors a bit. You are putting actual UI elements in your dataProvider. In my opinion, the only thing that should be in that dataProvider is raw data. In your case, it is a string and image data. You use an ItemRenderer to apply the view element to the data.

    So, just create an Object and forget about there being a BitmapImage in your dataProvider at all. That object has name and source properties.

    Then, create a simple itemRenderer that binds the name and the source properties of the data object which is automatically assigned for you.

    A little bit like this?

    <s:List id="list"
            horizontalCenter="0"
            verticalCenter="0">
        <s:layout>
            <s:TileLayout requestedColumnCount="3"
                          requestedRowCount="2"
                          horizontalGap="0"
                          verticalGap="0" />
        </s:layout>
        <s:dataProvider>
            <s:ArrayList>
                <fx:Object name="Truck" source="@Embed('../images/menus/car_types/truck.png')" />
                <fx:Object name="SUV" source="@Embed('../images/menus/car_types/suv.png')" />
                <fx:Object name="Convertible" source="@Embed('../images/menus/car_types/convertible.png')" />
                <fx:Object name="Sedan" source="@Embed('../images/menus/car_types/sedan.png')" />
                <fx:Object name="Surprise Me!" source="@Embed('../images/menus/car_types/surprise.png')" />
            </s:ArrayList>
        </s:dataProvider>
    
        <s:itemRenderer>
            <fx:Component>
                <s:ItemRenderer>
                    <s:HGroup>
                        <s:Label text="{data.name}" />
                        <s:BitmapImage source="{data.source}" />
                    </s:HGroup>
                </s:ItemRenderer>
            </fx:Component>
        </s:itemRenderer>
    </s:List>
    

    Of course, pretty up that ItemRenderer however you see fit, but use data binding to the data property for whatever property you need.

    Enjoy 🙂

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

Sidebar

Related Questions

This seems like it should be really simple, but I'm unable to figure this
This seems like it should be really simple, but for some reason, I'm not
This seems like it should be really simple to do but I just can't
I have what seems like it should be a really simple problem, but somehow
ok, this seems like it should be really simple but Im a bit confused:
Hey everyone, this seems like it should be a simple one; I really hope
New to ASP.NET MVC 3. This seems like it should be a really simple
This should be really simple. If I have a String like this: ../Test?/sample*.txt then
Really simple question: Am I missing something? Seems like this should be all that
This seems like it should be really simple. I compiled a library in Qt

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.