next up previous contents
Next: How does the synchronous Up: Using FFish script objects Previous: About the trace method   Contents

Handling events of the FFish script objects

For example, to handle the onContextMenu event, that is, to do something when right click the flash movie. First, we would have to create an instance of the corresponding FFish script object even if all its methods are static. Second, add an event handler in Action script. Finally, call the setEventHandler to set the event handler.
    import SWFKit.*;

    function onContextMenu()
    {
        Dialogs.msgBox("Right click!");
    }

    var fp = new FlashPlayer;
    fp.setEventHandler("onContextMenu", onContextMenu);



Copyright ©2000-2010 Shanghai TopCMM Software Technologies. All Rights Reserved.