2 Replies Latest reply on May 29, 2014 8:33 AM by JRHall

    Is is possible to bind an action in bootstrap function?

    viniciusjs

      I would like to handle some external functions (phonegap sound) when the user click in a button that was inside my animation, what is the best way to do that?

       

      AdobeEdge.bootstrapCallback(function(compId) {

       

      // "comp" is now equivalent to the Stage's "sym" variable.

      comp = AdobeEdge.getComposition(compId).getStage();

       

       

      // is it possible? how?

      Symbol.bindElementAction(compId, symbolName, "${_ButtonNext2}", "click", function(sym, e) {

               sym.play("dois");

       

            });

      //comp.getStage().getSymbol("rotatingSquare").play();

      });

       

      Best Regards

        • 1. Re: Is is possible to bind an action in bootstrap function?
          JRHall Level 1

          I am having a similar problem.

           

          Have you found any answers?

          • 2. Re: Is is possible to bind an action in bootstrap function?
            JRHall Level 1

            I have been doing some work on this and it seems that, once you have the bootstrapCallback loaded and you have set the comp variable, you can use the internal buttons to trigger events in the main html.

             

            I say it seems, because I have only got so far with it. I am trying to use the internal button to increase a counter variable ("i") and then use the value of i to load bootstrapped comps.

             

            comp.getStage.$("FWD").click(function(){

                 i++;

            }

             

            Using alerts I have confirmed that clicking the button does increase i (though not by 1, the first click jumped i up to 5!)

             

            I have also found that by hard coding an i value in a click event attached to the button within the comp also affects the i set in the main html.

             

            My problem is that i does not seem to do its job in changing the comps. No matter what value i changes to, I am still looking at comp1.