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
| <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" creationComplete="init()">
<mx:Script>
<![CDATA[
import mx.collections.ArrayCollection;
import mx.utils.ObjectProxy;
public function init():void
{
var ac:ArrayCollection = new ArrayCollection();
var o:Object= {nom:"Dupont",prenom:"Jean",mail:"dupont@mail.fr",currentState:"Viewable"};
var o2:Object = {nom:"Baptiste",prenom:"Pierre",mail:"baptiste@mail.fr",currentState:"ViewableMail"};
var result:Array = new Array();
result.push(o);
result.push(o2);
for(var i:String in result) result[i] = new ObjectProxy(result[i]);
ac = new ArrayCollection(result);
liste.dataProvider = ac;
}
]]>
</mx:Script>
<mx:HBox width="100%">
<mx:List id="liste" itemRenderer="composantcell" width="150" height="200"/>
</mx:HBox>
</mx:Application> |
Partager