Using A function in another game object

heres my code:
portalEnter.js(Character)

function OnControllerColliderHit (hit : ControllerColliderHit) {
	if (Input.GetKeyUp(KeyCode.UpArrow)) {
		hit.gameObject.Enter();
	}
}

Portal.js(portal)

var mapid:int;
var X:float;
var Y:float;

function Enter (a:int) {
Application.LoadLevel(mapid);
}

i want “portalEnter” to call Enter() in “Portal” and in the new scene set the X and the Y in “Portal” To The Position of the player in the new scene. how do i do that?
i have tried EVERYTHING please help.

You use BroadcastMessage.

Here’s how the first part of your code should look instead.

var a : int;

function OnControllerColliderHit (hit : ControllerColliderHit) {
    if (Input.GetKeyUp(KeyCode.UpArrow)) {
hit.gameObject.BroadcastMessage("Enter",a,SendMessageOptions.DontRequireReceiver);
    }
}

Have you tried this? http://unity3d.com/support/documentation/ScriptReference/index.Accessing_Other_Components.html