「main」と「TimerCountDown」という 2 つのクラスがあります。「main」クラスの「TimerCountDown」から単一の関数「reset」を呼び出そうとしました。
これは私の 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();
}
}
メインクラスの関数でリセット機能を使用して、メインクラスで参照を作成するにはどうすればよいですか? 私は sth like しかできません
var myTimerObject:TimerCountDown = new TimerCountDown(timer, "seconds", 40, "0!", this);
しかし、リセット機能の呼び出しについてはわかりません。