PDA

View Full Version : Cell Renderer???


careyr69
10-27-2005, 12:50 AM
class ImageRenderer extends MovieClip
{
private var image_mc:MovieClip;
private var imageID:Number;
function ImageRenderer ()
{
this.createEmptyMovieClip ("image_mc", 100);
image_mc._xscale = 17;
image_mc._yscale = 17;
image_mc._x = 3;
image_mc._y = 2;
}
function setValue (suggested:String, itembject, selected:String):Void
{
if (item.LN == undefined)
{
this.image_mc.unloadMovie ();
this.imageID = undefined;
}
if (item != undefined && (this.imageID != item.LN || image_mc.getBytesLoaded () == 0))
{
this.image_mc.loadMovie ("images/0" + item.LN + "_00.jpg");
this.imageID = item.LN;
}
}
}

how would I ammend this code so it goes to a standard image like no photo or something if the image is not in the folder? I'm getting errors and blank spaces on the datagrid now if there is not picture. I would like it to just show the image "00000_00.jpg"

thanks!!!