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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T10:32:56+00:00 2026-06-08T10:32:56+00:00

I have a Spark list which needs different images loaded into it based on

  • 0

I have a Spark list which needs different images loaded into it based on data coming through from an SQlite query.

In SQLite I have a column called “IconId” which for example might contain the value “1”, “2”, “3” etc representing an icon image.

My Icon images are Embedded in a class called “ImageResources” as follows:

[Bindable]
public class ImageResources
{

[Embed(source="../assets/caticons/icon1.jpg")]
    public static var Ic1Cla:Class;

[Embed(source="../assets/caticons/icon2.jpg")]
    public static var Ic2Cla:Class;
}

Then I have the itemrenderer for my Spark List which has a Bitmap which I use to set the icon I want to use for the list item like this.. This is a static example which works:

<s:BitmapImage source="{ImageResources.Ic1Cla}"   
         x="5" y="2">

</s:BitmapImage>

My question is..Can I dynamically concatenate the BitmapImage source somehow to something that will take the number coming from my SQLite data e.g “1” into something like this:

<s:BitmapImage source="{ImageResources.Ic[data.IconId]Cla}"   
         x="5" y="2">

</s:BitmapImage>

Obviously this doesn’t work but I’m not sure if it’s a simple syntax issue or whether it could even be done in this manner.

Any help would be much appreciated.

  • 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-06-08T10:32:59+00:00Added an answer on June 8, 2026 at 10:32 am

    You can dynamically access a variable such as:

    <s:BitmapImage source="{ImageResources['Ic' + data.IconId + 'Cla']}" />
    

    There are other approaches, such as using a state system. By setting the current state as in currentState = "image" + data.IconId; this could be implemented as:

    <s:states>
        <s:State name="image1" />
        <s:State name="image2" />
    </s:states>
    
    <s:BitmapImage source.image1="{ImageResources.Ic1Cla}"
                   source.image2="{ImageResources.Ic2Cla}" />
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a regular spark list which is sorted correctly when no item renderer
I have a spark list control whose data is rendered using an itemrenderer. Basically
I have a Flex Spark List which can be populated with any number of
I have an ArrayCollection that is the dataProvider for a spark.components.List , which has
I have a Spark List component with custom Item Renderer. Data provider for the
I have a spark.components.List component on which I would like the vertival scroll to
I have a simple list with a tileLayout of images. From the examples I've
... while still enabling it scroll? I have a Spark List running in a
In Flex 4 (beta 2), I have a list control populated from an XMLListCollection.
I have a list of events. Each event as a Start and End which

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.