global variable problem

i have two scripts. one called speedtest

static var speedometre = 1;

function OnGUI () {
    if (GUI.Button (Rect (10,120,80,20), "speed")) {
        if (speedometre == 1){
            speedtest.speedometre = 3;
        }
        else{
            speedtest.speedometre = 1;
        }
    }
}

and one called myspeed

function Update () {
    if (myspeed.speedometre == 1){
        if (Input.GetKey("up")){
            transform.Translate(1*Time.deltaTime, 0, 0);
        }
        if (Input.GetKey("down")){
            transform.Translate(-1*Time.deltaTime, 0, 0);
        }
        if (Input.GetKey("right")){
            transform.Rotate(0, 3*Time.deltaTime, 0);
        }
        if (Input.GetKey("left")){
            transform.Rotate(0, -3*Time.deltaTime, 0);
        }
    }
    else{
        if (Input.GetKey("up")){
            transform.Translate(150*Time.deltaTime, 0, 0);
        }
        if (Input.GetKey("down")){
            transform.Translate(-150*Time.deltaTime, 0, 0);
        }
        if (Input.GetKey("right")){
            transform.Rotate(0, 3*Time.deltaTime, 0);
        }
        if (Input.GetKey("left")){
            transform.Rotate(0, -3*Time.deltaTime, 0);
        }
    }
}

but unity come up with the error:

“‘speedometre’ is not a member of ‘myspeed’”
how can i fix this error?

or if you have the scipts on different gameObjects, you're referencing the wrong scripts! in the myspeed, you have

myspeed.speedometer

you don't need that. if you're trying to reference the speed of the other script, do

speedtest.speedometer 

in the myspeed script.

I don't think you have defined speedometre in the myspeed.js file. If you are referencing the speedometre from the speedtest script, then use GetComponent to get the script and then access the variable.