Object Communication

Need someone to shine some light here.

I currently have a class called SearchObject that has the following function:


public function performSearch(searchQuery) {
		
		// Create XML object to perform the search
		search_xml = new SearchScripts.ResultXML(resultHandler, apiLink, appId, searchQuery);
		
	}

So, it basically creates another object from another class defintion when performSearch is called. Now this new object created extends the XML object, and what I would like it to do is, whenever it actually loads it call a function from the first object I created (the SearchObject object).

I have done this but not the way I would like to. Right now, whenever I create the XML object I pass the resultHandler function in the argument and call it whenever the XML loads, but isn’t there a way for it to call the resultHandler function directly from the first one and not assign it as a method of the XML object.

That sounded kinda confusing… hope it’s understandable. :crazy:

Cheers!