make UI image disappear on when button is heldbutton?

I have a UI Image in my scene. I want it to turn off when you hold a button. I have a script that turns off a GUI Texture, but I don’t know how to change it. Here’s my code…

var aimTexture : GUITexture;
function Update() {
    // Only enable aim texture when 'Aim' button is not pressed.
    // In this case I have used 'Shift' key for this.
    if (Input.GetButton("Aim"))
        aimTexture.enabled = true;
    else
        aimTexture.enabled = false;
}

Are you trying to disable a new UI image or prevent a legacy GUI from drawing?

simply change

var aimTexture : GUITexture;

to

var aimTexture : Image;

I tried it. It doesn’t recognize “Image”.