flashactionscript-3flash-cs4jsfl

JSFL - reading metadata onDocumentChanged


I am building a flash panel that reads metadata from a .fla when it is active in the Flash IDE. This panel is also storing metadata in the .fla and that is no problem. What is problematic is that I do not know how to stop the event listener from listening for onDocumentChange.

I want it to listen for it as long as it is open, but when it's closed it should clean up after itself because trying to read metadata every time a new document is selected is not a very nice thing to do.

I have tried to listen for all kind of events in the panel to detect when the user closes it, but with no success.

Anyone knows anything about this?


Solution

  • I've done a lot of work with Events in JSFL, and the sad truth is that the system is flawed. Document events are fine, but layer and frame events are very unreliable; executing in the wrong order, layer events not firing when you come out of an edit, etc, etc.

    Polling from the panel is often the best way to do it, and is not such a performance hit.

    Document events however, are OK. The documentation on how to remove them is incorrect, see Dru Kepple's post here on what you should do:

    http://summitprojectsflashblog.wordpress.com/2010/11/08/jsfl-get-fl-removeeventlistener-to-work/