Problems with broadcasting and reciever

Hello I just started up on Unity agian, and I have walked into som problems

This is the script there send the message “ApplyDamage” when input.fire1 have been pressed:

		var fireRate : float = 0.5;
private var nextFire : float = 0.0;


function Update () 
{
	if (Input.GetButton ("Fire1")  Time.time > nextFire) {
		nextFire = Time.time + fireRate;
		BroadcastMessage ("ApplyDamage");
		}
	}

This is the the game object there was planned to recieve the message

var Player : GameObject;
Player = GameObject.Find("Player");
var distance : float;


function Update () 
{
	distance = Vector3.Distance(transform.position, Player.transform.position);
}


function ApplyDamage (){


	if(distance < 20){
		Debug.Log("ramt");
 		Destroy (gameObject);	
}

}

This is 2 different object, and i get the error:
BroadcastMessage ApplyDamage has no receiver!
UnityEngine.Component:BroadcastMessage(String)

I don’t really understand javascript, but hte “no receiver” error message appears when the object receiving the broadcast does not have any active component (or the object is disabled) to receive the message. Also… the code looks strange. I mean, where are you specifying who to broadcast the message? It looks more like you are broadcasting the message to the sending object itself.

The first script is at Object A

The second script is at Object B

Kirlim, the plan is that Object A is player, when it hit Fire1 which is Attack, it sends out the message.

Objebt B is the enemy and the reciever, and when it gets the “ApplyDamage” message it will check how far it is from the Object A before it destroys

I found the solution

The player who shall attack have the script

		var fireRate : float = 0.5;
private var nextFire : float = 0.0;
		var Enemy : GameObject[]; // Making the variable to be an array


function Update () 
{
	nextFire = Time.time + fireRate; // Decides Rate of fire
	
	if (Input.GetButton ("Fire1")  Time.time > nextFire) {
	SendNewMessage(); //Calling the function
	}
}

function SendNewMessage(){
		
		// Define Enemy with all Gameobjects with tag "Enemy"
		Enemy = GameObject.FindGameObjectsWithTag("Enemy"); 
		
		//List up all the enemy it could find, and then send it.
		for(var i = 0; i<Enemy.length; i++){
			Enemy[i].SendMessage("ApplyDamage");
		
		}
	

}

And the enemy have this script:

var Player : GameObject;
Player = GameObject.Find("Player");
var distance : float;


function Update () 
{
	distance = Vector3.Distance(transform.position, Player.transform.position);
}


function ApplyDamage (){


	if(distance < 20){
		Debug.Log("ramt");
 		Destroy (gameObject);	
}

}