Search code examples
apache-flexflex4flex4.5flexbuilder

Embed image in list


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>

Solution

  • 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/