Quantcast
Channel: Adobe Community : All Content - Edge Animate
Viewing all articles
Browse latest Browse all 9897

variable created on click in edgeActions.js but want to reference it in external js file

$
0
0


Hi, I created a variable on-click in edgeActions.js but want to reference it in external js file. This is where I am at so far:

 

In my edgeActions.js I st a variable on compositionReady and then use it when I click on the symbol: questionMarkR1. This works fine.. the problem is that I don't know how to reference the variable in my external js file. This first code is working from the edgeActions.js:

 

 

Symbol.bindElementAction(compId, symbolName, "document", "compositionReady", function(sym, e) {

 

        
         sym.setVariable("questionAsked", false); // sets the initial value

      });

 

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

 

         var questionAsked = sym.getVariable("questionAsked");
        
         alert(questionAsked);

 

         if (questionAsked)// if true
         {
         sym.$("checkButton2").removeClass( "hidden" );
         sym.$("popUp").removeClass( "hidden" );


         }
         else  //if false
         {

 

         sym.$("pic2a").removeClass( "hidden" );
         sym.$("pic2b").removeClass( "hidden" );
         sym.$("pic2c").removeClass( "hidden" );
         sym.$("pic2d").removeClass( "hidden" );
        
         sym.$("closeBox").removeClass( "hidden" );
         }

      });

 

This next part doesn't work because I don't know how to reference the variable correctly. This is what I have tried and it doesn't work:

 

     var questionAsked = sym.getComposition().getStage().getVariable("questionAsked");


     alert(questionAsked);


Viewing all articles
Browse latest Browse all 9897

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>