Why is GetComponent creating this error and how do I fix it?

This code brings up the error "BCE0022: Cannot convert 'UnityEngine.Component' to 'spawnWave'".

private var sw : spawnWave;

function Awake()
{
        sw = gameObject.Find("spawner").GetComponent("spawnWave");
}

Any help would be greatly appreciated, thanks.

This is not an error in Unity 3, where GetComponent is implemented with generics. Until then (which probably will be this week), just use as. Also, take the second set of quotation marks off. They're just cluttering and slowing down your code. So is using gameObject instead of GameObject. You also may not need to explicitly type your variable, depending on what else you're doing. Finally, start your script (class) names with a capital letter.

private var sw;

function Awake()
{
        sw = GameObject.Find("spawner").GetComponent(SpawnWave) as SpawnWave;
}

Don't explicitly set your variable type at the top:

var sw; // or private var sw;

instead of

private var sw : spawnWave;