views:

32

answers:

1

I have created a datagrid in ActionScript class and I want to add an Image to one of the columns..I tried to add an image this way..but it doesnot work..Can anyone help me..

[Embed(source="../../../../css/images/redCircleIcon.png")]  
public static const redIcon:Class;      
var statusRedImg:Image = new Image();  
statusRedImg.source = redIcon;                  
var dp:Array = new Array();  
dp.push({STATUS:statusRedImg,COL2:"1", DATE1:"09/09/2010 11:51:09 AM",
         LEVEL:"1200 34%", DATE2:"09/09/2010 11:51:09 AM",
         DATE3:"09/09/2010 11:51:09 AM"});  
myDataGrid.dataProvider = dp; 
+1  A: 

The only thing your code does is add an item to the dataProvider.

If you want to add an image to one of the columns you're going to have to create an itemRenderer for that column, which reaches into the relevant data element and uses that data to somehow display an image.

www.Flextras.com
Thanks for the tip...I was able to render the image.
subh