Quantcast
Channel: Adobe Community : Discussion List - After Effects Scripting
Viewing all articles
Browse latest Browse all 2143

app.addEventListener is undefined

$
0
0

Hi

 

I'm building a palette via scriptingUI. I'm trying to create a palette that changes depending on what you have selected. Is this not possible in AE?

 

This is a test code just to trouble shoot:

 

function SelectionViewer()

{

    var selectionViewer = this;

 

    this.buildUI = function (thisObj)

    {

        // dockable panel or palette

        var pal = (thisObj instanceof Panel) ? thisObj : new Window("palette", "selectionViewer", undefined, {resizeable:false});

 

        var testText = pal.add("statictext", [2, 2, 201, 20], "Selected Item");

    }

 

    // Methods

   

    selectionViewer.updateSelected = function()

    {

        testText.text = app.project.activeItem;

    }

 

    this.run = function (thisObj)

    {

        this.buildUI(thisObj);

 

        app.addEventListener("afterSelectionChanged", selectionViewer.updateSelected);

    };

}

 

new SelectionViewer().run(this);

 

It gives me this error:

 

"Unable to execute script at line 24. Funtion app.addEventListener is undefined"

 

Any help?

 

Thanks,

Wagner


Viewing all articles
Browse latest Browse all 2143

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>