Update text when object is clicked

Hi,

I am using a main class with a search field, ‘Search’ is a MovieClip:

public var searchField: Search

In another class i want to be able to say that when objects are clicked - update the search text with the variable name…

function onPlaneClick(evt:InteractiveScene3DEvent):void 


            replaceSearchText(name);
            
        }
    

function replaceSearchText(name : String) : void {            //Replace text function here 
            searchField.search_txt.text = name;
            trace("The artist to replace the search is:" + name);
        }

the error i am getting is 1120: access of undefined property searchField… even though searchField is a public var in Main.as

How can i replace the text when the plane is clicked ?