3 Replies Latest reply on Nov 5, 2013 9:20 PM by YOSHIOKA Ume

    Edge Click (or similar) action from an HTML hyperlink?

    ladobeugm Level 1

      OK, a little bit confusing in my subject title, but here goes....

       

      I have a text object in my Animate comp. It's pulling in HTML using JQuery's .html command. What I'd like to do is from that HTML, I'd like add an a href or similar link where onClick something happens to another Animate symbol. In this case, I'll make it simple and just show a div, but it could be anything. Of course, Animate has actions for symbols in the Elements panel, but this needs to happen from the HTML itself. Like this:

       

       

      sym.$('content').html('<p>If you click this link, the <a href="sym.$("gallery").show();">Photo Gallery</a> will appear.</p>');

       

      OK, this is a simplified version and I realize the syntax in the a href is completely wrong. But you get the idea. I click in that text and a div now appears on the screen. Also would be great to do it from an image link as well.

       

      So is there a way to do this in Edge Animate? It's important I need to find a way to make this work.

        • 1. Re: Edge Click (or similar) action from an HTML hyperlink?
          YOSHIOKA Ume Level 3

          Hi, ladobeugm.

          How about using window.AdobeEdge scope?

           

          //document.compositionReady

          //create an object for custom funcs
          var funcs = Edge.funcs = {};
          //create showGallery() func
          funcs.showGallery = function(){
            sym.$("gallery").show();
          };
          
          //call via window.AdobeEdge.funcs
          sym.$('content').html(
            'If you click this link, the <a href="javascript:window.AdobeEdge.funcs.showGallery();">Photo Gallery</a> will appear.'
          );
          

           

          HTH. Thanks.

          Ume.

          • 2. Re: Edge Click (or similar) action from an HTML hyperlink?
            ladobeugm Level 1

            That was awesome! It did work. Thanks so much.

             

            Now one final question. I'll probably have to do this a number of times throughout my project. Different text links for different show (or similar) actions. Would I only have to define var funcs just once and then use funcs.showWhatever and create a variety of functions for my different actions? Or do this each and every time?

             

            Hopefully, that made sense.

            • 3. Re: Edge Click (or similar) action from an HTML hyperlink?
              YOSHIOKA Ume Level 3

              hmm... like this?

              send a param from <a> href.

              var funcs = window.funcs = {};
              //show the elem received as a param.
              funcs.show = function($str){
                //hide all of .menuBox class etc..(if you want)
                //$(".menuBox").hide();
                //show $str elm
                sym.$($str).show();
              };
              
              sym.$('content').html(
                '<p>If you click this link, the ' +
                '<a href="javascript:funcs.show(&quot;gallery&quot;)">Photo Gallery</a>' + 
                ' will appear.</p>'
              );
              sym.$('anotherContent').html(
                '<p>click this link, the' +
                '<a href="javascript:funcs.show(&quot;another&quot;)">Another One</a>' + 
                ' will appear.</p>'
              );
              

               

              Quote is hard to see a little, but I think it can.

               

              Thanks.

              Ume.