|
|
fl.addEventListener()
AvailabilityFlash
CS3 Professional.
Usagefl.addEventListener(eventType, callbackFunction)
Parameters- eventType
- A string that specifies the event type to pass to this callback function.
Acceptable values are "documentNew", "documentOpened", "documentClosed", "mouseMove", "documentChanged", "layerChanged",
and "frameChanged".
The documentChanged value
doesn’t mean that the content of a document has changed; it means
that a different document is now in the foreground. That is, fl.getDocumentDOM() will
return a different value than it did before this event occurred.
- callbackFunction
- The name of the function you want to execute every time the
event occurs.
DescriptionMethod;
registers a function to be called when a specific event occurs.
When
using this method, be aware that if the event occurs frequently
(as might be the case with mouseMove) and the function
takes a long time to run, your application might hang or otherwise
enter an error state.
ExampleThe
following example displays a message in the Output panel when a document
is closed:
myFunction = function () {
fl.trace('document was closed'); }
fl.addEventListener("documentClosed", myFunction);
|