Aquí adjunto el código de la forma en que creo los botones, y asigno las imágenes.
Código :
for(var i:int =0;i<dpitemsgrupos.length;i++)
{
if(j==0)
{
var hg:HGroup = new HGroup();
vgroup3.addElement(hg);
}
j++;
var boton:spark.components.Button = new spark.components.Button();
boton.width = 140;
boton.height = 140;
boton.id = "ITE_"+dpitemsgrupos[i].ITE_CODIGO;
boton.label = dpitemsgrupos[i].ITE_DESCRIPCION;
//////Esta es la forma que busque he intentado hacerlo, pero no me muestra la imagen
ruta2 = pathWeb+"/SolucionEmpresarial/SigNum/fotos/"+dpitemsgrupos[i].ITE_IMAGEN;
boton.setStyle(ruta2,iconClass);
/////////////////
boton.addEventListener(MouseEvent.CLICK, adicionarItemgrupo);//aqui debo arreglar y llamar a un metodo filtrar items segun el id
hg.addElement(boton);
if(j>4)
{
j=0;
}
}
Por favor ayuda, si tal vez podrían ayudarme o corregir algo, otra forma que enontre es creando un script pero tampoco funciona:
Código :
<s:Script> boton.icon = @Embed(pathWeb+"/SolucionEmpresarial/SigNum/fotos/"+dpitemsgrupos[i].ITE_IMAGEN); </s:Script>
