Try to make a several buttons working with an external JAVAscript.
Can anybody tell/help me what I’m doing wrong?

Steps done before:
A. Create 2 buttons with the Widget Tool -> Template “Button” with Background “abcd.jpg”
B. Renamed the Button to “Button1” and “Button2”
C. Create a javascript buttonslection.js and attached this to " UI Root 2D"
Now I’m try to find out what button is pressed and make an action on the buttons..
function Update ()
{
if (UIEventListener.Get(GameObject.Find("Button1")).onClick != null)
{
Debug.Log ("do what you have todo is button 1 is pressed");
// Need to force Button 2 into NOT highlighted (change UIButton state -> xx?)
// Need to force Button 1 into (change UIButton state -> Pressed?)
}
if (UIEventListener.Get(GameObject.Find("Button2")).onClick != null)
{
Debug.Log ("do what you have todo is button 2 is pressed");
// Need to force Button 1 into NOT highlighted (change UIButton state -> xx?)
// Need to force Button 2 into (change UIButton state -> Pressed?)
}
}