(variable) is not a member of (script)

Hi, I’m new to programming in Javascript, and I’m having an issue with my script.
It won’t compile; instead Unity says “‘hitGround’ is not a member of ‘Collide’”.
I can’t figure this out. Can someone help me?

This is the script (named Collide.js) I made:

pragma strict

{
private var hitGround : boolean = true;
}

function Start ()

{
var hitGround = true;
}

function OnCollisionEnter(groundCollide : Collision)
	{
	if(groundCollide.gameObject.tag == "floor")
		this.hitGround = true;
	else
		{
		this.hitGround = false;
		}
}

function Update ()

{
	if(this.hitGround == true)
	{
		canJump = true;
	}
	else {}
}

Remove the curly braces around the declaration of hitGround, that will make that a local variable to the scope of the curly braces… which is just the definition and it’s out of scope. Also you need to declare canJump for what it’s worth.

#pragma strict
// don't wrap in curly braces as this will make a variable local scope to what is inside of the braces.
private var hitGround : boolean = true;