How to set and get value to and from scrollbar using textfield value?

I want to have one textfield which is able to set and get value to and form scrollbar. Here is my code:

using UnityEngine;
using System.Collections;

public class ExampleClass : MonoBehaviour 
{
	private float scrolledVal;
	private float temVal;

	void OnGUI() 
	{
		scrolledVal = GUI.HorizontalScrollbar (new Rect(20, 20, 100, 30), scrolledVal, 1.0F, 33f, 58f);	

		scrolledVal = float.Parse(GUI.TextField (new Rect(130, 20, 50, 20), scrolledVal.ToString()));
	}
}

That I can only get the value from scrollbar, but I cannot set value scrolled to scrollbar. Please help.

36823-capture.png

Are you version constrained? If not I would upgrade to the newest version of Unity. The UI tools introduced in 4.6 make this trivial.

I think you are looking for something like Single.Parse