listAcc.itemRenderer = new ClassFactory(MyItemRenderer);

Alex Harui
Flex SDK Developer
Adobe Systems Inc.<http://www.adobe.com/>
Blog: http://blogs.adobe.com/aharui

From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf 
Of Isabelle Loyer Perso
Sent: Sunday, January 29, 2012 11:04 AM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] Flex icon filed on list



Thanks for this answer.
Can you explain to me how to refer to item renderer in AS3.
Thanks

Le 29/01/12 19:01, Alex Harui a écrit :

The default itemrenderer doesn't load external images as icons.  You will need 
a custom itemRenderer.

Alex Harui
Flex SDK Developer
Adobe Systems Inc.<http://www.adobe.com/>
Blog: http://blogs.adobe.com/aharui

From: flexcoders@yahoogroups.com<mailto:flexcoders@yahoogroups.com> 
[mailto:flexcoders@yahoogroups.com] On Behalf Of isa_loyer
Sent: Sunday, January 29, 2012 8:48 AM
To: flexcoders@yahoogroups.com<mailto:flexcoders@yahoogroups.com>
Subject: [flexcoders] Flex icon filed on list



Hi,

I load label and icon from mysql database.

and i'd like to create a list with label and icon field.

So I try to do something like that but it doesn't work indeed each line contain 
label but icon is empty.

var xmllisteFamille:XMLList = XML(event.result).famille;
var xmlListCollFami = new XMLListCollection(xmllisteFamille);
for each (var item:Object in xmlListCollFami){
var vbox:VBox = new VBox;
vbox.label = item.sdfNom;
trace(vbox.label);
vbox.percentHeight=100;
vbox.percentWidth=100;
var xmlItem2:XMLList = item.commDent;
if(xmlItem2.length()>0){

/*
var listAcc:List = new List();
listAcc.percentHeight = 100;
listAcc.percentWidth =100;
listAcc.labelField = "name";
listAcc.dataProvider = xmlItem2;
vbox.addChild(listAcc);
accOnglet1.addChild(vbox); */
var urlImageRoot : urlManager = new urlManager();
var urlRootDental:String = urlImageRoot.urlDental();
trace(urlRootDental);
var list:Array = new Array();
var object:Object;

var xmlListdetail:XMLListCollection = new XMLListCollection(xmlItem2);
for each (var item2:Object in xmlListdetail)
{

object = new Object();
// -- --
object.label = item2.name;

var rootIcon:String= "http://127.0.0.1:10088/Sys/OEMySQL/Dental/"+item2.photo;
trace("rootIcon " + rootIcon);

object.icon = rootIcon;

trace("object.icon " + object.icon);

list.push(object);
}

/* var aNode:XML;
for each (aNode in xmlItem2)
{
object = new Object();
// -- --
object.label = aNode.name;
object.icon = new urlManager().urlDental()+aNode.photo;
list.push(object);
} */

var arrList:ArrayList;

arrList = new ArrayList(list);
var listAcc:List = new List();
listAcc.percentHeight = 100;
listAcc.percentWidth =100;
listAcc.labelField = "label";
listAcc.iconField="icon";
//listAcc.dataProvider = xmlItem2;
listAcc.dataProvider = arrList;
vbox.addChild(listAcc);
accOnglet1.addChild(vbox);
}

}

}
}

I hope that you can help me.

Thanks

Reply via email to