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

When is a variable global?

$
0
0

We have a problem setting a global variable.

 

I have a Stage with a single Symbol. The Stage contains this action on compositionReady:

var varfoo = 'varbar';

sym.symfoo = 'symbar';

alert('After compositionReady, varfoo is '+varfoo+'.');

alert('After compositionReady, symfoo is '+sym.getComposition().getStage().symfoo+'.');

 

These alerts display the values of both variables just fine at the start of the animation.

However...

Inside the Symbol, the end of its Timeline contains this action:

alert('End of Symbol Timeline');

alert('varfoo is '+varfoo+'.');

alert('symfoo is '+sym.getComposition().getStage().symfoo+'.');

 

Only the first alert appears, which indicates that neither variable is global.

Why are they not global? I thought that the Stage.compositionReady event handler was the place to store functions and variables that are global to all symbols.


Viewing all articles
Browse latest Browse all 9897

Trending Articles



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