2 Replies Latest reply on Nov 25, 2010 8:44 AM by flexillu10

    How can I cache images in TileLayout List


      (I'm reposting this because there are edits and the account on the forums got screwed up and the old topic cannot be edited)


      Hi, I'm using a List with a TileLayout with  1000s of images and setting an ItemRenderer that is displaying each  image from a dynamic source (outside url). I have played around with  some of the caching options:


      1. using a dictionary to store bitmap data

      2.  using my own TileLayout where in the updateDisplayList I try to force the virtual elements to  render

      3. trying to not use virtual layout


      but they all  have their disadvantages and I'm only finding that what I need is going  to be in a paging system. So i'm reaching out here to see if anyone has  any hints or suggestions on how to do what I want w/o reverting back to  a paging system. Essentially the problem is this, the List uses  virtualLayout by default which I love but the viewport on the scroller  doesn't render the items that you are about to view until they are already  on the screen.


      Using  option 1 above, I have to manually track the images in the Dictionary  to determine what I can release or cache but I am still not able to render items quick enough to remove any flicker and the act of scrolling 1000s of images tends to start chunking and lagging behind the mouse.


      Using option 2 above, I created my own TileLayout and overrode the updateDisplayList function to try to force the elements that were in the virtual list to render. In doing this the items start to draw on the screen in locations where they are not supposed to show up (I will post another item on this). Is there a way to force the viewport to  think its visible area is larger so items off screen will render before  they are visible?


      My end goal is to get a list that as you scroll  through it does not flicker for the most part and doesn't use tons of  memory. If a user is scrolling quickly through the list I'm ok with some  flicker.