as3corelib icon indicating copy to clipboard operation
as3corelib copied to clipboard

After unwatch() is called in FileMonitor, eventListener is removed but is never re-added on watch().

Open darronschall opened this issue 15 years ago • 0 comments

Originally filed by [email protected] on 2010-05-01T07:49:51

What steps will reproduce the problem?

  1. call watch()
  2. call unwatch()
  3. call watch()

What is the expected output? What do you see instead? I expected the code to still monitor the file and throw the FileMonitorEvent.CHANGE event, however, the listener is removed, therefore the event is never called.

In the file, FileMonitor.as just remove: timer.removeEventListener(TimerEvent.TIMER, onTimerEvent); in the function unwatch(). Since you already called timer.stop() there is no reason to remove the listener.

Thanks, James Hartig @fastest963

darronschall avatar Jul 28 '10 20:07 darronschall