1

I am having a list which is rendered to display images , name of all images is in dataprovider of list. Now i am unable to find how to make all images as embedded images as the name is coming from dataprovider?

Below is list:

    <s:List itemRenderer="imglist">
        <s:dataProvider>
            <s:ArrayList>
                <fx:String>img1.jpg</fx:String>
                <fx:String>img2.jpg</fx:String>
                <fx:String>img3.jpg</fx:String>
            </s:ArrayList>
        </s:dataProvider>
    </s:List>
Kirk Woll
  • 76,112
  • 22
  • 180
  • 195
user1190524
  • 65
  • 1
  • 13

3 Answers3

1

You can try something like that: http://blog.flexexamples.com/2009/09/29/displaying-images-in-a-spark-list-control-using-a-custom-item-renderer-in-flex-4/

2 minutes search in google :)

Of coure you don't have to create custom itemrenderer, instead try this solution: http://blog.flexexamples.com/2009/09/18/displaying-images-in-a-spark-list-control-in-flex-4/

Misiu
  • 4,738
  • 21
  • 94
  • 198
0

You'll have to loop through the list of images in your dataprovider and import them into your application. I provided a similar answer here.

Community
  • 1
  • 1
Jason Towne
  • 8,014
  • 5
  • 54
  • 69
0
    <s:List itemRenderer="imglist" dataField="src">
        <s:dataProvider>
            <s:ArrayList>
                <fx:Object src="@Embed('img1.jpg')" />
                <fx:Object src="@Embed('img2.jpg')" />
                <fx:Object src="@Embed('img3.jpg')" />
            </s:ArrayList>
        </s:dataProvider>
    </s:List>

Maybe it will give you some new idea ;)

Antonos
  • 573
  • 2
  • 10