as3corelib
as3corelib copied to clipboard
After unwatch() is called in FileMonitor, eventListener is removed but is never re-added on watch().
Originally filed by [email protected] on 2010-05-01T07:49:51
What steps will reproduce the problem?
- call watch()
- call unwatch()
- 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