vincent
vincent

Reputation: 1323

How doe an addEventListenerDocument work?

i'm curently working on a indesign extension in flex and as3. I can get my head around something, the following:

addEventListenerDocument    ()  method
public function addEventListenerDocument(eventTypeParam:String = null, handlerParam:Object = null, capturesParam:Boolean = false):EventListener

I'm using this as following:

document.addEventListenerDocument(DocumentEvent.AFTER_SAVE, afterSaveHandler);

and then the following function

private function afterSaveHandler(e:DocumentEvent):void {
    trace("test");
}

This isnt working. I get an error that i should ad a File or javascript function instead of a Function.

Can someone please explain me how i can get this working?

More info about the event here

Upvotes: 1

Views: 214

Answers (1)

Loic Aigon
Loic Aigon

Reputation: 506

The help you included contains the info although I admit it's not obvious while reading it :

handlerParam:Object (default = null) — (Object) The event handler. Can accept: File or JavaScript Function

You may find interest in reading this cookbook : http://cookbooks.adobe.com/post_Communicating_between_JavaScript_and_the_Creative-17383.html

Good luck ;)

Upvotes: 1

Related Questions