Does anyone have an example of this, I've been trying for days and I can't figure it out.
Help...
Here is one of the things I've tried:
var aTimer = new System.Timers.Timer(10000);
aTimer.add_Elapsed(handler);
}
public function handler(sender: Object, e : ElapsedEventArgs){ }
Your
aTimer
object appears to be a local variable within a function, which means that it may get garbage collected. Try moving it to a field in your class.Also, after you set the
Elapsed
property, you need to start the timer: