I have a custom item renderer which displays a different gif in the row depending on data value from the data object. When i set the image source url using the absolute path and not embedding it works fine however when i embed the images i find that when i scroll up and down the grid the images get messed up and sometimes sit on top of each other.
Does anyone have any ideas on why embedding images in my hbox item renderer is causing so hassle;
code
public var equipment:Image;
public var compr_icons:Bitmap = new AssetManager.COMPUTER_ICON;
.. do some logic
equipment.addChild(compr_icons);
In your item renderer, try overriding the
datasetter (which gets called implicitly by the SDK for each item in your dataProvider as you navigate through whichever data-bound control you happen to be using), and setting the image’ssourceproperty from there, like so:… and see if that helps. Flex is probably trying to reuse the visual elements of the renderer, not realizing your intention is to swap them out as your data changes. By taking action then (when the data item gets set), you’re able to control more explicitly what happens with the visual elements of the renderer.
Hope that helps!