Salut, j'ai un mx: Liste avec un DataProvider. Ce fournisseur de données est un ArrayCollection si FotoItemsFlex Liste ItemRenderer avec image perd BitmapData lors du défilement
public class FotoItem extends EventDispatcher
{
[Bindable]
public var data:Bitmap;
[Bindable]
public var id:int;
[Bindable]
public var duration:Number;
public function FotoItem(data:Bitmap, id:int, duration:Number, target:IEventDispatcher=null)
{
super(target);
this.data = data;
this.id = id;
this.duration = duration;
}
}
mon itemRenderer ressemble à ceci:
<?xml version="1.0" encoding="utf-8"?>
<mx:VBox xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx" >
<fx:Script>
<![CDATA[
import mx.collections.ArrayCollection;
]]>
</fx:Script>
<s:Label text="index"/>
<mx:Image source="{data.data}" maxHeight="100" maxWidth="100"/>
<s:Label text="Duration: {data.duration}ms"/>
<s:Label text="ID: {data.id}"/>
</mx:VBox>
Maintenant, quand je suis défilement alors toutes les images qui laissent l'écran disparaître :(Lorsque je prends un coup d'oeil la ArrayCollection BitmapData est nul.
de chaque article Pourquoi est-ce le cas?
J'ai essayé de changer data.data en quelque chose d'autre mais cela ne fonctionne pas plus. Je n'utilise pas arrayCollection dans mon moteur de rendu. Le fournisseur de données est un arrayCollection. Je pense aussi que cela a à voir avec le recyclage. mais il ne devrait pas modifier les données dans arrayCollection, devrait-il? Je regarde les données dans ma vue de débogage –