You'll have to stop the Timer instance, otherwise the Timer will continue to fire. For example, you could add a public stop() function to the PingTime class:

public function stop():void
{
  if (timer)
  {
    timer.stop();
    timer.removeEventListener(TimerEvent.TIMER, sayPing);
    timer = null;
  }
}

And in the main Application:

private function stopPing():void
{
  ping.stop();   
  ping = null;
  trace("ping: " +ping);
}

Dirk.


-----Ursprüngliche Nachricht-----
Von: [email protected] im Auftrag von Sonja Duijvesteijn
Gesendet: Di 16.05.2006 21:25
An: [email protected]
Betreff: Re: [flexcoders] Re: delete class instances

Thank you for your swift answers, but either I just don't get it, or it's
not working. I've changed the function stopPing to the following:

private function stopPing():void {
    ping = null;
    trace("ping: " +ping);
}

The trace does say (as expected) "ping: null", but it doesn't make the bad
ping go away.

Btw, there was a small mistake in my example, the click should obviously be
on the button and not the textarea.

Any other ideas/hints?



--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com




YAHOO! GROUPS LINKS




<<winmail.dat>>

Reply via email to