javascriptactionscript-3flashjsfl

How to listen Flash pro actions?


I want to develop plugin to listen Flash's (not Flash Player but when using Flash CC making .fla) actions and do something.

I have learnt jsfl can extend Flash,but it's based on running command by user.Now I want to listen some specific actions such as add new Item into library.So what shall I learn? Can AS do this ?

Thanks!


Solution

  • Have a look at fl.addEventListener() in the JSFL reference You can listen for these events: "documentNew", "documentOpened", "documentClosed", "mouseMove", "documentChanged", "layerChanged", and "frameChanged".

    for example:

    fl.addEventListener("mouseMove",onMouseMove);
    function onMouseMove(){
       fl.trace("mouse moved");
    }
    

    You should also check out xJSFL. It's pretty handy when scripting Flash.