2 Replies Latest reply on Oct 19, 2009 2:22 AM by Subeesh Arakkan

    creating an array of jpg images

    jcahill23

      hi. i want to create an array of jpg images and wrap them in an arrayCollection which will serve as the dataprovider for a TileList...

      the images are located in a "asset" folder within the src folder...tried both actionscript and mx tags and can't figure out how to create an array of images.

       

      thanx.

        • 1. Re: creating an array of jpg images
          Rahul Kamra Level 1

          Can't  u make the source in array and use that source as dataprovider?

           

          -Rahul Kamra

          • 2. Re: creating an array of jpg images
            Subeesh Arakkan Level 4

            You need to use ItemRenderers to display images in list based controls.

             

            Here is an example in mxml

             

            <mx:TileList>
                    <mx:dataProvider>
                        <mx:ArrayCollection>
                            <mx:Array>
                                <mx:Object source="assets/image1.jpg"/>
                                <mx:Object source="assets/image2.jpg"/>
                                <mx:Object source="assets/image3.jpg"/>
                            </mx:Array>
                        </mx:ArrayCollection>
                    </mx:dataProvider>
                    <mx:itemRenderer>
                        <mx:Component>
                            <mx:Image source="{data.source}"/>
                        </mx:Component>
                    </mx:itemRenderer>
                </mx:TileList>    

             

            Check this livedocs page

            http://livedocs.adobe.com/flex/3/html/help.html?content=cellrenderer_8.html