Extending Flash |
|
|
|
| Objects > flash object (fl) > fl.addEventListener() | |||
Flash CS3 Professional.
fl.addEventListener(eventType,callbackFunction)
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".
|
NOTE |
The |
callbackFunction A string that specifies the function you want to execute every time the event occurs.
Nothing.
Method; 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.
The 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);
|
|
|
|