'main'과 'TimerCountDown'이라는 두 개의 클래스가 있습니다. 'main'클래스의 'TimerCountDown'에서 'reset'이라는 단일 함수를 호출하려고했습니다.다른 클래스의 메소드 호출하기 Action Script 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();
}
}
내가 메인 클래스의 참조가 메인 클래스의 기능에 리셋 기능을 사용하여 만들 수있는 방법
? 나는 단지 sth처럼 할 수있다.
var myTimerObject:TimerCountDown = new TimerCountDown(timer, "seconds", 40, "0!", this);
그러나 리셋 기능을 호출하는 것에 관해서는 모른다.