Search code examples
javascriptjqueryadobe-edge

How to bindElementAction with class elementSelector in Edge Animate


I am trying to play my stage when I hover over a <button class="play">. I have not created this button in Adobe Edge Animate.

This is what my code looks like:

Symbol.bindElementAction(compId, symbolName, ".play", "mouseenter", function(sym, e) {
         sym.play();
});

This doesn't work at all, but if I replace ".play" with something like "document" or "div" it works fine (not "button" though for some reason).

I've also tried "$(.play)" and "$('.play')" with no success.

How can I target a class to bind an action to?

Many thanks!


Solution

  • Found the answer elsewhere.

    You can access the symbol by doing:

    var myComp = AdobeEdge.getComposition("compositionname");
    var mySymbol = myComp.getSymbol("symbolname");
    // var myStage = myComp.getStage(); if all you want is the stage
    

    Then you can do things like:

    $(".play").mouseenter(function(e) {
      mySymbol.play();
    });
    

    Source Adobe Edge: control a specific symbol from html page