Projector Toggling - Scripting Problem

I am currently running into a scripting problem in my game when trying to toggle a projector on and off. While my game is running, I can toggle the projector off but not on again afterwards. If I turn on the projector manually while the game is running (via the inspector) I can turn it off again, but still not on afterwards. Here is the Java script that I have:

    var projector : Projector;
function Update()
    {
        if(Input.GetButtonDown("Fire2"))
        {
            projector.gameObject.active = !projector.gameObject.active;
        }
    }

Any help on fixing this problem is greatly appreciated.

You want to toggle the projector component's enabled status instead of disabing the gameobject the script is probably on:

projector.enabled = !projector.enabled;