error BCE0005 - Unknown identifier

Hi to everyone, I’m studying Unity by using Will Goldstone’s Unity Game Development Essentials edited by Packt Publishing Ltd (2009). I’m doing the lesson about the first script making.
I’ve two errors with the script:

Assets/Scripts/PlayerCollisions.js(29,44): BCE0005: Unknown identifier: ‘animName’.
and
Assets/Scripts/PlayerCollisions.js(30,44): BCE0005: Unknown identifier: ‘animName’.

This is the code I wrote:

#pragma strict
private var doorIsOpen : boolean = false;
private var doorTimes : float = 0.0;
private var currentDoor : GameObject;
var doorOpenTime : float = 3.0;
var doorOpenSound : AudioClip;
var doorShutSound : AudioClip;
function Start () {

}

function Update () {

if(doorIsOpen) {
doorTimes += Time.deltaTime;

if(doorTimes > 3){
Door(doorShutSound, false, “doorshut”, currentDoor);
doorTimes = 0.0;
}
}

}

function OnControllerColliderHit(hit : ControllerColliderHit){
if(hit.gameObject.tag == “outpostDoor” doorIsOpen == false){
currentDoor = hit.gameObject;
Door(doorOpenSound, true, “dooropen”, currentDoor);
var animName = new animName();
var thisDoor = new thisDoor();
thisDoor.animation.Play(animName);
}
}

Door(doorShutSound, false, “doorshut”, currentDoor);

function Door(aClip : AudioClip, openCheck : boolean, animName : String, thisDoor : GameObject){
audio.PlayOneShot(aClip);
doorIsOpen = openCheck;

thisDoor.transform.parent.animation.Play(animName);
}

@script RequireComponent(AudioSource)

I don’t understand where is the error

I’ve Unity 3.5.6f4 installed and I use the free version of the software.

Can you help me?
Thanks

First, it is helpful to people trying to help you if you put your code between code tags ( “CODE” inside before your code and “/CODE” inside at the end of your code, without the quotes of course. If this doesnt make sense, check out http://forum.unity3d.com/threads/143875-Using-code-tags-properly for more details and other methods to use the code tag.

Now, to your problem, I am still a beginner myself, but it looks like these two lines do not have a type declared (the “: type” part that should go between the variable name and the “=”):

var animName = new animName();
var thisDoor = new thisDoor();

You might also need to define animName().

I am also using a different version of unity than you, so its possible my answer might be wrong.

Hopefully this will help you get things strait, and I’m sorry if this information is wrong.

Please don’t take this as a definitive solution, however, in my unity, placing “: String” between “animName” and “= new animName” took away one of the errors I had when placing it into a script I already had open. You may need a different type, and some other corrections for your script to function the way you want and remove all the errors.