0
我有兩個名爲'main'和'TimerCountDown'的類。我試圖從'main'類中的'TimerCountDown'調用一個'reset'函數。來自另一個類的調用方法動作腳本3
這是我TimerCountDown類:
public class TimerCountDown extends MovieClip
{
public function TimerCountDown(t:TextField, timeType:String, timeValue:Number, es:String, _documentclass):void
{
this.documentclass = _documentclass;
this.tfTimeDisplay = t;
if (timeType == "seconds")
{
this.timeInSeconds = timeValue;
}
if (timeType == "minutes")
{
this.timeInSeconds = timeValue * 60;
}
this.tfEndDisplayString = es;
this.startTimer();
}
public function reset():void{
clockCounter.reset();
}
}
如何創建主類的引用使用復位功能在主類的功能是什麼?我只能這樣做
var myTimerObject:TimerCountDown = new TimerCountDown(timer, "seconds", 40, "0!", this);
但不知道調用復位功能。