1 Reply Latest reply on Aug 12, 2014 9:53 AM by eliverrang

    How can I use a custom js file to specify link destinations?

    eliverrang Level 1

      If I use a rectangle to create a button (name "ExitRight"), I specify the button action in a click script. So, to go to a web page using the click script, I enter:


      window.location= " window.location="https://www.google.com/";


      This works fine and if I look in the edgeAction.js file I find:


      //Edge symbol: 'engine_anim'

         (function(symbolName) {  

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

               // insert code for mouse click here



            //Edge binding end


         //Edge symbol end


      Now, what I really want to do is be able to change the destination the button takes me to by using a global variable to specify the destination:

      something like...

      window location = myDestination;

      ...where myDestination is a global created in  an external custom js document loaded in to the script library


      Just putting...

      myDestination = "https://www.google.com/";

      ...into the external js doc doesn't work. So how can I accomplish this?


      Peter Small

        • 1. Re: How can I use a custom js file to specify link destinations?
          eliverrang Level 1

          It must be summer vacation time. Questions are not being answered and this is the third question that I've had to find out the answer for myself.


          The solution I found (from a post by hemanth kumar r https://forums.adobe.com/thread/1479495) was to make variables and functions properties of AdobeEdge.


          So in the external .js document a variable is declared and given a value:


          AdobeEdge.myVariableName = "The variable value";

          To use it in a symbol/element:




          And a function is declared:

          AdobeEdge.myFunctionName(param){...function code...} //param optional


          To call these in a symbol/element:



          Peter Small