Copy link to clipboard
Copied
Hi I'm trying to stop a timer in stopwatch class from MainMenu class. But my code doesn't work, here is my code:
in MainMenu class i've method:
public function pauseGame (e:MouseEvent){
timestop = new Stopwatch();
timestop.Stoptimer(); }
in class Stopwatch i try to stop my timer with:
public function Stoptimer(){
timer.stop();
timer.removeEventListener(TimerEvent.TIMER, timeFun);
return; }
You need to pass a reference to the Timer to the Stoptimer class.
Copy link to clipboard
Copied
You need to pass a reference to the Timer to the Stoptimer class.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now