0
New Here
,
/t5/animate-discussions/how-to-stop-a-timer-from-another-class/td-p/5180641
Jun 14, 2013
Jun 14, 2013
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; }
TOPICS
ActionScript
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
1 Correct answer
LEGEND
,
Jun 15, 2013
Jun 15, 2013
You need to pass a reference to the Timer to the Stoptimer class.
LEGEND
,
LATEST
/t5/animate-discussions/how-to-stop-a-timer-from-another-class/m-p/5180642#M136437
Jun 15, 2013
Jun 15, 2013
Copy link to clipboard
Copied
You need to pass a reference to the Timer to the Stoptimer class.
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

