Javascript Class Update

Hi

I have a class established like so:

public class TowerClass{

	//RUNS EVERY FRAME
	function think(){
		....
	}

	//SET THE TYPE OF TOWER
	function settype(type:int){
                ....	
	}

}

I can access the settype() method in a separate script fine. In my main script I am trying to manually update the class think() via the Update() function. The main Update() looks like this:

function Update () {

	keys.Update();
	
	for(i = 0; i<18; i++){
		for(n = 0; n<12; n++){
		    m.towerarray*[n].think();*
  •       }*
    
  •   }*
    

}
For some reason the think() method is never being called, or at least never run. There are no errors.
Have I misunderstood how the Update() function works?
Thanks

Have you verified that Update is being called? The script containing the Update function must be on a GameObject somewhere to have Update called on it.

The Update() function is definitely being called, but I don’t think the, think() is being run at all.