changing material

Hi,

How can I change material when the health reaches 0

the structure of the enemy is --

enemy/Armature_001/Mball_006 and the material is attached to the Mball_006

Here is the code I am using

Thanks

var newmat : Material;
var curHealth=30;
var dieHealth=0;
var flag:Transform;

function ApplyDamage (damage : float) {

    curHealth -= damage;
    print (curHealth);
    if(curHealth <= dieHealth) {
        die();
    }
}
function die()
{

//body = transform.Find("enemy/Armature_001/Mball_006");
Debug.Log("I was called");
renderer.material=newmat ;
}

also I am setting the variable newmat through the inspector

I found the answer thank you

var newmat : Material;
var curHealth=30;
var dieHealth=0;
var flag:Transform;

function ApplyDamage (damage : float) {

    curHealth -= damage;
    print (curHealth);
    if(curHealth <= dieHealth) {
        die();
    }
}
function die()
{

body = transform.Find("Armature_001/Mball_006");
Debug.Log("I was called");
body.renderer.material=newmat ;
}