Bueno, he encontrado como poner el icono en la derecha en una lista. Ese icono es un MovieClip y tambien he logrado que ese icono (MovieClip) se pueda introducir componentes de todas clases, etc, pero no he podido implementar el mismo resultado en un TREE. Si alguien tiene alguna idea, estaría muy agradecido que me ayudara.
Código :
import mx.controls.List;
class RightIconCell extends MovieClip {
// Declare a movie clip property to display the icon.
private var _mIcon:MovieClip;
// Declare the "inherited" methods and properties.
private var listOwner:List;
private var owner:MovieClip;
private var getCellIndex:Function;
private var getDataLabel:Function;
function RightIconCell() {
init();
}
private function init():Void {
// Create the movie clip to display the icon.
createEmptyMovieClip("_mIcon", 1);
}
// For preferred width and height use the row's width and height.
public function getPreferredWidth():Number {
return owner.width;
}
public function getPreferredHeight():Number {
return owner.height;
}
// You don't need any implementation for setSize() since changing the
// dimensions of the parent component won't affect the cell other than to
// possibly crop it.
public function setSize(nWidth:Number, nHeight:Number):Void {
}
public function setValue(sLabel:String, oItem:Object, sState:String):Void {
// Get the icon field value from the data provider element.
var nIndex:Number = getCellIndex().itemIndex;
var sIcon:String = listOwner.dataProvider.getItemAt(nIndex).icon;
// Attach the icon symbol, and move it to the right of the label.
_mIcon.attachMovie(sIcon, "mIconHolder", 1);
//_mIcon._x = _tLabel._width;
}