You had a couple of mistakes. This is the new script. You forgot to connect to the Renderer class. Then the attributes, and that is mandatory, have to be data for the image url and title for the title.
PHP Code:function loaderCompleteHandler (event:Event):void
{
var playersXML:XML = new XML(event.currentTarget.data);
var photoCol:DataGridColumn = new DataGridColumn("data");//has to be data
photoCol.headerText = "Photo";
photoCol.width = 120;
photoCol.cellRenderer = LoaderCellRenderer;//you forgot this line.
var nameCol:DataGridColumn = new DataGridColumn("title");//has to be title
nameCol.headerText = "Name";
nameCol.width = 60;
var myDP:DataProvider = new DataProvider(playersXML);
var aDg:DataGrid = new DataGrid();
aDg.columns = [photoCol, nameCol];
aDg.width = 200;
aDg.rowHeight = 64;
aDg.dataProvider = myDP;
aDg.rowCount = aDg.length;
addChild (aDg);
}
PHP Code:<players>
<player data="bear.jpg" title="Smokey"/>
<player data="lion.jpg" title="Leo"/>
</players>




Reply With Quote
