1 Reply Latest reply on Feb 25, 2015 9:24 AM by joel_pau

    Time trigger alternative to Edge Hero

    BruceMCE Level 1

      I'm trying to create a time trigger for a video. For instance, when a video gets to 3 seconds, a photo will appear on the Stage. I tried using Edge Hero's Time Trigger but, according to Edge Hero, it no longer works (I'd sent them an email about it). As an alternative I tried using this:

       

      // Start Example

             // declare your video element into a variable called vid

             var vid = sym.$("VideoSymbolName")[0];

       

       

             // listen for the timeupdate event, and when it reaches a certain point in time (currentTime), say 3 sec mark, Do something.

             vid.addEventListener("timeupdate", function() {

                   if (this.currentTime >= 3) {

                     // Do Something This code loads a symbol into a container

                        var firstS = sym.createChildSymbol("SymbolName", "ContainerName");

                   }

              }, false);

      // End Example

       

       

      This loads the photo's Symbol, except that it keeps loading the Symbol into the Container (no matter what size the container is), so there are multiple instances of the Symbol on the Stage when I just want one.

       

      Any ideas?
      Thanks

        • 1. Re: Time trigger alternative to Edge Hero
          joel_pau Level 5

          Hi,

           

          You can get it using Edge API: sym.getComposition().getSymbols("SymbolName").length

           

          The conditional statement is: if ( sym.getComposition().getSymbols("symbolName").length == 0) { var firstS = sym.createChildSymbol("SymbolName", "ContainerName"); }

          One and only instance will be created.

          if (this.currentTime >= 3) {

                            if ( sym.getComposition().getSymbols("symbolName").length == 0) { var firstS = sym.createChildSymbol("SymbolName", "ContainerName"); }

          }

          1 person found this helpful