SOLVED!: getting customStyle by name

Having trouble accessing a custom style by name. I managed to set up a custom style as part of a skin (inspectorSkin) and named it “areaBackground”. I would expect this to work:

var inspectorSkin : GUISkin;

function OnGUI () 
{
GUI.skin = inspectorSkin;
GUILayout.BeginArea (Rect (20,10, 191, 128),inspectorSkin.areaBackground);
}

What I am trying to avoid is having to reference the style as “inspectorSkin.customStyles[someIndex]”.

Thanks!

Figured it out … For anyone interested, this solves the problem:

var inspectorSkin : GUISkin;

function OnGUI ()
{
GUI.skin = inspectorSkin;
GUILayout.BeginArea (Rect (20,10, 191, 128),GUIStyle("areaBackground"));
}