TileList redraw bug?

Ask a Question related to Macromedia Flex General Discussion, Design and Development.

  1. #1

    Default TileList redraw bug?

    Hi folks,
    Is there any known bug with the TileList component?
    Basically, I display thumbnails in the TileList component with custom
    itemRenderer and It seems like after updating ArrayCollection with new values,
    it receives values OK, but wont update the actual images.
    Thank you in advance,
    Alex



    alex-party Guest

  2. Similar Questions and Discussions

    1. TileList Paging
      Hi everyone, I could not able to find the code for how to do TileList paging. If you have the code. Then please kindly post it. So that I can use...
    2. Tilelist itemRenderer
      Hi, I'm creating a thumb photo gallery and I'm using a tilelist component as the itemrederer of the list, for itemrender I'm using a mxml...
    3. Help! Help! Help! TileList Problem
      Hello, I am trying to get my TileList to show the image in my catalog site. I am using an XML that contains the images and an itemRenderer to...
    4. Problem with TileList
      I have written code where the user selects a directory and all the contents of the directory are displayed in a TileList. At least that is what I...
    5. TileList oddities
      I have found TileList to be very problematic when resized with effects and when using hPosition/vPosition in conjunction with states. For...
  3. #2

    Default Re: TileList redraw bug?

    I'm having this problem as well. I have a bunch of thumbnails in TileList that
    when i update the array and select a new set of thumbnails they do not refresh
    with the correct set (the old thumbnails remain) but if I click on one of the
    result thumbnails i do get the details for the updated (correct) image.

    So like above it seems to receive all values ok but the thumbnail set does not
    update.

    Anyone know what might be causing this?

    Thanks in advance

    Paul



    pashe Guest

  4. #3

    Default Re: TileList redraw bug?

    To reproduce the mentioned above problem, here is short example:

    <mx:Application ... creationComplete="srv.send()">
    <mx:Script>
    <![CDATA[
    [Bindable] public var imgs:ArrayCollection;
    [Bindable] public var _url:String="vars.php";

    private function srv_result(evt:ResultEvent):void {
    var obj:Object=evt.result;
    imgs=obj.start.imgs.image;
    }

    ######### 1. lets say user pressed a button and invoked this function, which
    populates new values into IMGS array.
    ######### 2. values received from srv_result() function are OK, but images
    won't update in TileList component
    public function xgo(name:String):void{ function.
    srv.url=_url+'?name='+name; srv.send();
    }

    ]]>
    </mx:Script>

    <mx:HTTPService id="srv" url="{_url}" result="srv_result(event)"/>
    <mx:TileList dataProvider="{imgs}" itemRenderer="views.xImg" />

    </mx:Application>

    alex-party Guest

  5. #4

    Default Re: TileList redraw bug?

    After digging more into code, I've found, that my itemRenderer component have
    been loading images on "initialize" event once, then when ArrayCollection
    changes, there is no "initialize" event happening anymore, that's why images
    are not updating, so is there any way I could add event listener on TileList or
    itemRenderer to trigger initialize event once more or force redraw it after
    ArrayCollection changed?

    =========== itemRenderer component ================
    <mx:Canvas initialize="init()">
    <mx:Script>
    <![CDATA[
    private function init():void{
    var request:URLRequest = new URLRequest(
    'assets/gallery/small/'+data.filename+'.jpg' );
    var loader:Loader = new Loader();
    loader.contentLoaderInfo.addEventListener( Event.COMPLETE, cropImage );
    loader.load( request );
    }
    private function cropImage(event : Event):void{
    ....croping image here and loading into x_img.source.....
    }
    </mx:Script>
    <mx:Image id="x_img" x="5" y="3"/>

    </mx:Canvas>

    Thanks,
    Alex

    alex-party Guest

  6. #5

    Default Re: TileList redraw bug?

    Well, thank you all, but I found a solution to this problem myself and it seems
    to be working. All I had to do is add dataChange event to the itemRenderer
    component, like that:

    =========== itemRenderer component ================
    <mx:Canvas dataChange="init()">

    I hope this will help someone,
    Regards,
    Alex

    alex-party Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139