2 Replies Latest reply on Feb 10, 2010 5:07 PM by jsd99

    Cache of images

    jsd99 Level 3

      I'm trying to cache a bunch of images in an array and just set an MXML component property when it's time to reuse the image, but nothing ever happens.  The image doesn't get displayed at all.


      In my main MXML file, I have a function that does something like:


      if (!avatarCache[take.user_id]) {
         avatarCache[take.user_id] = new Image();         
         avatarCache[take.user_id].source = "http://localhost:732/user/avatar_redirect?id=" + take.user_id;

      visibleTake.avatar = avatarCache[take.user_id];



      visibleTake is an MXML component and avatar is an mx:Image tag.  Nothing is shown where the mx:Image tag is.  I tried setting width/height/x/y on the cached values.  No dice.