<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:clearspace="http://www.jivesoftware.com/xmlns/jive/rss" version="2.0">
  <channel>
    <title>Adobe Community: Message List - how do you create &amp; use global variables in edge animate?</title>
    <link>https://forums.adobe.com/community/edge_animate?view=discussions</link>
    <description>Most recent forum messages</description>
    <language>en</language>
    <pubDate>Mon, 12 Aug 2013 15:41:20 GMT</pubDate>
    <generator>Jive Engage 7.0.0.1  (http://jivesoftware.com/products/)</generator>
    <dc:date>2013-08-12T15:41:20Z</dc:date>
    <dc:language>en</dc:language>
    <item>
      <title>Re: how do you create &amp; use global variables in edge animate?</title>
      <link>https://forums.adobe.com/message/5587436?tstart=0#5587436</link>
      <description>&lt;!-- [DocumentBodyStart:12411d6f-1543-4e94-b6cd-cea6df67462d] --&gt;&lt;div class="jive-rendered-content"&gt;&lt;p&gt;Also you can get/set the values from a textbox (or rectangle element too) hidden or out of Stage:&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;// set or initialise values&lt;/p&gt;&lt;p&gt;sym.$("globalVariables").data("globalVariable1",0);&lt;/p&gt;&lt;p&gt;sym.$("globalVariables").data("globalVariable2","No");&lt;/p&gt;&lt;p&gt;sym.$("globalVariables").data("globalVariable3","red");&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;// get values&lt;/p&gt;&lt;p&gt;color = sym.$("globalVariables").data("globalVariable3");&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Maybe is not elegant but it's simple and works fine.&lt;/p&gt;&lt;p&gt;&lt;a class="jive-link-external-small" href="http://www.w3schools.com/jquery/misc_data.asp" rel="nofollow"&gt;http://www.w3schools.com/jquery/misc_data.asp&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;&lt;!-- [DocumentBodyEnd:12411d6f-1543-4e94-b6cd-cea6df67462d] --&gt;&lt;img src='/beacon?t=1415894598743' /&gt;</description>
      <pubDate>Mon, 12 Aug 2013 15:38:44 GMT</pubDate>
      <author>forums_noreply@adobe.com</author>
      <guid>https://forums.adobe.com/message/5587436?tstart=0#5587436</guid>
      <dc:date>2013-08-12T15:38:44Z</dc:date>
      <clearspace:dateToText>1 year 3 months ago</clearspace:dateToText>
      <clearspace:objectType>0</clearspace:objectType>
    </item>
    <item>
      <title>Re: how do you create &amp; use global variables in edge animate?</title>
      <link>https://forums.adobe.com/message/5514060?tstart=0#5514060</link>
      <description>&lt;!-- [DocumentBodyStart:cfd264b5-dc51-402b-8ae3-84387acd3ac0] --&gt;&lt;div class="jive-rendered-content"&gt;&lt;p&gt;For some reason, you may actually need to call the function from &lt;strong&gt;inside&lt;/strong&gt; another symbol (and not from the instances as before). New version of the same exercise with the following structure where each rectangle and the associated text is wrapped in a symbol &lt;span style="color: #808080;"&gt;object&amp;lt;i&amp;gt;&lt;/span&gt; :&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;a href="https://forums.adobe.com/servlet/JiveServlet/showImage/2-5514060-362286/Capture+d%E2%80%99e%CC%81cran+2013-07-17+a%CC%80+18.28.47.png"&gt;&lt;img alt="Capture d&amp;#8217;écran 2013-07-17 à 18.28.47.png" class="jive-image" height="159" src="https://forums.adobe.com/servlet/JiveServlet/downloadImage/2-5514060-362286/Capture+d%E2%80%99e%CC%81cran+2013-07-17+a%CC%80+18.28.47.png" width="218"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;To make the function accessible from another symbol, you add &lt;span style="color: #008000;"&gt;sym.&lt;/span&gt; (the parameter of &lt;span style="color: #008000;"&gt;substr() &lt;/span&gt;is also adapted to the new &lt;span style="color: #008000;"&gt;id&lt;/span&gt;)&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span style="color: #808080;"&gt;Stage&lt;/span&gt;.&lt;span style="color: #008000;"&gt;compositionReady&lt;/span&gt; event handler :&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span style="color: #008000;"&gt;total = 0;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color: #808080;"&gt;//-----------------------------------------&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color: #008000;"&gt;&lt;strong&gt;sym.&lt;/strong&gt;incrementByInstanceNum = function( eClick)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color: #008000;"&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color: #808080;"&gt;&amp;nbsp; // console.log( eClick.target.getAttribute("id"));&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color: #808080;"&gt;&amp;nbsp; // =&amp;gt; "Stage_object&lt;strong&gt;2&lt;/strong&gt;_yellowRect2_RoundRect" for example&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span style="color: #008000;"&gt;&amp;nbsp; var num = eClick.target.getAttribute("id").substr(&lt;strong&gt;12&lt;/strong&gt;,1);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color: #008000;"&gt;&amp;nbsp; total += parseInt( num);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color: #008000;"&gt;&amp;nbsp; sym.$("total").html( "total " +total);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color: #008000;"&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Each of the &lt;span style="color: #808080;"&gt;object&amp;lt;i&amp;gt;.yellowRect&amp;lt;i&amp;gt;&lt;/span&gt;.&lt;span style="color: #008000;"&gt;click&lt;/span&gt; event handler becomes :&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span style="color: #008000;"&gt;&lt;strong&gt;sym.getComposition().getStage()&lt;/strong&gt;.incrementByInstanceNum( e);&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span style="color: #008000;"&gt;&lt;a href="https://forums.adobe.com/servlet/JiveServlet/showImage/2-5514060-362287/Capture+d%E2%80%99e%CC%81cran+2013-07-17+a%CC%80+18.29.01.png"&gt;&lt;img alt="Capture d&amp;#8217;écran 2013-07-17 à 18.29.01.png" class="jive-image jive-image-thumbnail" height="204" src="https://forums.adobe.com/servlet/JiveServlet/downloadImage/2-5514060-362287/450-204/Capture+d%E2%80%99e%CC%81cran+2013-07-17+a%CC%80+18.29.01.png" width="450"/&gt;&lt;/a&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;The link given above has been updated and now includes this second version.&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Gil&lt;/p&gt;&lt;/div&gt;&lt;!-- [DocumentBodyEnd:cfd264b5-dc51-402b-8ae3-84387acd3ac0] --&gt;</description>
      <pubDate>Wed, 17 Jul 2013 16:41:16 GMT</pubDate>
      <author>forums_noreply@adobe.com</author>
      <guid>https://forums.adobe.com/message/5514060?tstart=0#5514060</guid>
      <dc:date>2013-07-17T16:41:16Z</dc:date>
      <clearspace:dateToText>1 year 4 months ago</clearspace:dateToText>
      <clearspace:objectType>0</clearspace:objectType>
    </item>
    <item>
      <title>Re: how do you create &amp; use global variables in edge animate?</title>
      <link>https://forums.adobe.com/message/5514641?tstart=0#5514641</link>
      <description>&lt;!-- [DocumentBodyStart:be9a83dd-b0cc-49bc-91ab-5ed66b558abc] --&gt;&lt;div class="jive-rendered-content"&gt;&lt;p&gt;hee..hee ... i agree... considering i started just one week back... &lt;span aria-label="Silly" class="emoticon-inline emoticon_silly" style="height:16px;width:16px;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;!-- [DocumentBodyEnd:be9a83dd-b0cc-49bc-91ab-5ed66b558abc] --&gt;</description>
      <pubDate>Wed, 17 Jul 2013 19:26:03 GMT</pubDate>
      <author>forums_noreply@adobe.com</author>
      <guid>https://forums.adobe.com/message/5514641?tstart=0#5514641</guid>
      <dc:date>2013-07-17T19:26:03Z</dc:date>
      <clearspace:dateToText>1 year 4 months ago</clearspace:dateToText>
      <clearspace:objectType>0</clearspace:objectType>
    </item>
    <item>
      <title>Re: how do you create &amp; use global variables in edge animate?</title>
      <link>https://forums.adobe.com/message/5514393?tstart=0#5514393</link>
      <description>&lt;!-- [DocumentBodyStart:7e6deeae-6eab-4d60-a8c6-8499f45ab19e] --&gt;&lt;div class="jive-rendered-content"&gt;&lt;p&gt;You're welcome, Maulshre &lt;span aria-label="Happy" class="emoticon-inline emoticon_happy" style="height:16px;width:16px;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;I remember some time ago when all this made me crazy &lt;span aria-label="Silly" class="emoticon-inline emoticon_silly" style="height:16px;width:16px;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Gil&lt;/p&gt;&lt;/div&gt;&lt;!-- [DocumentBodyEnd:7e6deeae-6eab-4d60-a8c6-8499f45ab19e] --&gt;</description>
      <pubDate>Wed, 17 Jul 2013 18:13:51 GMT</pubDate>
      <author>forums_noreply@adobe.com</author>
      <guid>https://forums.adobe.com/message/5514393?tstart=0#5514393</guid>
      <dc:date>2013-07-17T18:13:51Z</dc:date>
      <clearspace:dateToText>1 year 4 months ago</clearspace:dateToText>
      <clearspace:replyCount>1</clearspace:replyCount>
      <clearspace:objectType>0</clearspace:objectType>
    </item>
    <item>
      <title>Re: how do you create &amp; use global variables in edge animate?</title>
      <link>https://forums.adobe.com/message/5514382?tstart=0#5514382</link>
      <description>&lt;!-- [DocumentBodyStart:fa324a47-3378-4643-afb9-fbe1e29fdf9b] --&gt;&lt;div class="jive-rendered-content"&gt;&lt;p&gt; Thanks a tonne S. Amuli. Really appreciate your time and effort. &lt;span aria-label="Happy" class="emoticon-inline emoticon_happy" style="height:16px;width:16px;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;!-- [DocumentBodyEnd:fa324a47-3378-4643-afb9-fbe1e29fdf9b] --&gt;</description>
      <pubDate>Wed, 17 Jul 2013 18:05:14 GMT</pubDate>
      <author>forums_noreply@adobe.com</author>
      <guid>https://forums.adobe.com/message/5514382?tstart=0#5514382</guid>
      <dc:date>2013-07-17T18:05:14Z</dc:date>
      <clearspace:dateToText>1 year 4 months ago</clearspace:dateToText>
      <clearspace:replyCount>2</clearspace:replyCount>
      <clearspace:objectType>0</clearspace:objectType>
    </item>
    <item>
      <title>Re: how do you create &amp; use global variables in edge animate?</title>
      <link>https://forums.adobe.com/message/5513893?tstart=0#5513893</link>
      <description>&lt;!-- [DocumentBodyStart:909ee2fd-1855-4802-b7c9-203f014230b1] --&gt;&lt;div class="jive-rendered-content"&gt;&lt;p&gt;For example, if you increment the variable by the number of the clicked instance and display this cumulative count in a text field :&lt;/p&gt;&lt;p&gt;&lt;a href="https://forums.adobe.com/servlet/JiveServlet/showImage/2-5513893-362285/Capture+d%E2%80%99e%CC%81cran+2013-07-17+a%CC%80+18.07.07.png"&gt;&lt;img alt="Capture d&amp;#8217;écran 2013-07-17 à 18.07.07.png" class="jive-image jive-image-thumbnail" height="192" onclick="" src="https://forums.adobe.com/servlet/JiveServlet/downloadImage/2-5513893-362285/450-192/Capture+d%E2%80%99e%CC%81cran+2013-07-17+a%CC%80+18.07.07.png" width="450"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;You must initialize your variable outside of the function.&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span style="color: #808080;"&gt;Stage&lt;/span&gt;.&lt;span style="color: #008000;"&gt;compositionReady&lt;/span&gt; event handler :&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span style="color: #008000;"&gt;total = 0;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color: #808080;"&gt;//-----------------------------------------&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color: #008000;"&gt;incrementByInstanceNum = function( eClick)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color: #008000;"&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color: #808080;"&gt;&amp;nbsp; // console.log( eClick.target.getAttribute("id"));&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color: #808080;"&gt;&amp;nbsp; // =&amp;gt; "Stage_yellowRect1_RoundRect", "Stage_yellowRect2_RoundRect", etc.&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span style="color: #008000;"&gt;&amp;nbsp; var num = eClick.target.getAttribute("id").substr(16,1);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color: #008000;"&gt;&amp;nbsp; total += parseInt( num);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color: #008000;"&gt;&amp;nbsp; sym.$("total").html( "total " +total);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color: #008000;"&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;See that thread for explanations about the use of the event objet (&lt;span style="color: #008000;"&gt;eClick&lt;/span&gt; here) :&lt;/p&gt;&lt;p&gt;&lt;span style="color: #008000;"&gt;&lt;a class="jive-link-message-small" data-containerId="4823" data-containerType="14" data-objectId="5513055" data-objectType="2" href="https://forums.adobe.com/message/5513055#5513055"&gt;http://forums.adobe.com/message/5513055#5513055&lt;/a&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Each of the &lt;span style="color: #808080;"&gt;yellowRect&amp;lt;i&amp;gt;&lt;/span&gt;.&lt;span style="color: #008000;"&gt;click &lt;/span&gt;event handler :&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span style="color: #008000;"&gt;incrementByInstanceNum( e);&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Downloadable example here : &lt;a class="jive-link-external-small" href="https://app.box.com/s/aiysjhmvx8eb9do60s5u" rel="nofollow"&gt;https://app.box.com/s/aiysjhmvx8eb9do60s5u&lt;/a&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Gil&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;PS : it's option 2, because there is no need to communicate between symbols,&lt;/p&gt;&lt;p&gt;as the instances are all in the symbol &lt;span style="color: #808080;"&gt;Stage&lt;/span&gt;.&lt;/p&gt;&lt;/div&gt;&lt;!-- [DocumentBodyEnd:909ee2fd-1855-4802-b7c9-203f014230b1] --&gt;</description>
      <pubDate>Wed, 17 Jul 2013 16:09:48 GMT</pubDate>
      <author>forums_noreply@adobe.com</author>
      <guid>https://forums.adobe.com/message/5513893?tstart=0#5513893</guid>
      <dc:date>2013-07-17T16:09:48Z</dc:date>
      <clearspace:dateToText>1 year 4 months ago</clearspace:dateToText>
      <clearspace:objectType>0</clearspace:objectType>
    </item>
    <item>
      <title>Re: how do you create &amp; use global variables in edge animate?</title>
      <link>https://forums.adobe.com/message/5513821?tstart=0#5513821</link>
      <description>&lt;!-- [DocumentBodyStart:73ddec5c-2a5e-4565-80e9-4aed8bb577bc] --&gt;&lt;div class="jive-rendered-content"&gt;&lt;p&gt;this will get ya done:&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Symbol.bindSymbolAction(compId, symbolName, "creationComplete", function(sym, e) {&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var total = 0; //this is private&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sym.globalFunction = function(value){&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //this is global you can call it by getting an instance of the symbol ie. sym.getSymbol('whatever').globalFunction(5);&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; total += value;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;&lt;p&gt;});&lt;/p&gt;&lt;p&gt;//Edge binding end&lt;/p&gt;&lt;/div&gt;&lt;!-- [DocumentBodyEnd:73ddec5c-2a5e-4565-80e9-4aed8bb577bc] --&gt;</description>
      <pubDate>Wed, 17 Jul 2013 15:53:12 GMT</pubDate>
      <author>forums_noreply@adobe.com</author>
      <guid>https://forums.adobe.com/message/5513821?tstart=0#5513821</guid>
      <dc:date>2013-07-17T15:53:12Z</dc:date>
      <clearspace:dateToText>1 year 4 months ago</clearspace:dateToText>
      <clearspace:objectType>0</clearspace:objectType>
    </item>
    <item>
      <title>Re: how do you create &amp; use global variables in edge animate?</title>
      <link>https://forums.adobe.com/message/5513458?tstart=0#5513458</link>
      <description>&lt;!-- [DocumentBodyStart:2fca89ce-5396-46f2-9dd2-29baef9ce691] --&gt;&lt;div class="jive-rendered-content"&gt;&lt;p&gt;thanks for the response and listing various options...&lt;/p&gt;&lt;p&gt;i'm trying to use your option3 to target cumulative addition of numbers with previous retained value whenever that function is called.&amp;nbsp; &lt;/p&gt;&lt;p&gt;eg, the statement within my globalFunction() is total=total+x. Here i'm facing two problems: &lt;/p&gt;&lt;p&gt;Q.1 how to initialize total to 0 without including that in my function else my cumulative total will again get reset whenever the function is called? &lt;/p&gt;&lt;p&gt;Q.2 Is there any specific format for passing a numeral value (x) in this function?&lt;/p&gt;&lt;/div&gt;&lt;!-- [DocumentBodyEnd:2fca89ce-5396-46f2-9dd2-29baef9ce691] --&gt;</description>
      <pubDate>Wed, 17 Jul 2013 14:46:12 GMT</pubDate>
      <author>forums_noreply@adobe.com</author>
      <guid>https://forums.adobe.com/message/5513458?tstart=0#5513458</guid>
      <dc:date>2013-07-17T14:46:12Z</dc:date>
      <clearspace:dateToText>1 year 4 months ago</clearspace:dateToText>
      <clearspace:replyCount>3</clearspace:replyCount>
      <clearspace:objectType>0</clearspace:objectType>
    </item>
    <item>
      <title>Re: how do you create &amp; use global variables in edge animate?</title>
      <link>https://forums.adobe.com/message/5513115?tstart=0#5513115</link>
      <description>&lt;!-- [DocumentBodyStart:c418c4d8-a15d-44e5-812d-766fd6af0aaf] --&gt;&lt;div class="jive-rendered-content"&gt;&lt;p&gt;Hi maulshre,&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;1) Preceding the name of a variable with &lt;span style="color: #008000;"&gt;var&lt;/span&gt; makes it local.&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;2) &amp;#171; Global &amp;raquo; (but local to a symbol)&amp;nbsp; variable:&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;You can define in the &lt;span style="color: #808080;"&gt;Stage.&lt;span style="color: #008000;"&gt;compositionReady&lt;/span&gt;&lt;/span&gt; event handler a function callable from somewhere else in the &lt;span style="color: #808080;"&gt;Stage&lt;/span&gt; symbol :&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span style="color: #008000;"&gt;instanceNum = function( eRollover)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color: #008000;"&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color: #008000;"&gt;&amp;nbsp; console.log( eRollover.target.getAttribute("id"));&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color: #008000;"&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Then each of the instances on stage of a given symbol &lt;span style="color: #808080;"&gt;yellowRect&lt;/span&gt; (with instance names &lt;span style="color: #808080;"&gt;yellowRect1&lt;/span&gt;, &lt;span style="color: #808080;"&gt;yellowRect2&lt;/span&gt;, &lt;span style="color: #808080;"&gt;yellowRect3&lt;/span&gt; and &lt;span style="color: #808080;"&gt;yellowRect4&lt;/span&gt;) can have a &lt;span style="color: #008000;"&gt;mouseover&lt;/span&gt; event handler which is a call to the global function :&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span style="color: #008000;"&gt;instanceNum( e);&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;3) Truly global variable (accessible from every symbol) :&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Definition in a symbol (usually inside the &lt;span style="color: #808080;"&gt;Stage.&lt;span style="color: #008000;"&gt;compositionReady&lt;/span&gt;&lt;/span&gt; event handler, a good place for global stuff) :&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span style="color: #008000;"&gt;sym.globalFunction = function()&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color: #008000;"&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color: #808080;"&gt;&amp;nbsp; // statements&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color: #008000;"&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;To call this function from another symbol :&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span style="color: #008000;"&gt;sym.getComposition().getStage().globalFunction();&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Here the variable holds a function, but it could hold a number, string, etc.&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Gil&lt;/p&gt;&lt;/div&gt;&lt;!-- [DocumentBodyEnd:c418c4d8-a15d-44e5-812d-766fd6af0aaf] --&gt;</description>
      <pubDate>Wed, 17 Jul 2013 12:42:26 GMT</pubDate>
      <author>forums_noreply@adobe.com</author>
      <guid>https://forums.adobe.com/message/5513115?tstart=0#5513115</guid>
      <dc:date>2013-07-17T12:42:26Z</dc:date>
      <clearspace:dateToText>1 year 4 months ago</clearspace:dateToText>
      <clearspace:replyCount>4</clearspace:replyCount>
      <clearspace:objectType>0</clearspace:objectType>
    </item>
    <item>
      <title>how do you create &amp; use global variables in edge animate?</title>
      <link>https://forums.adobe.com/message/5512963?tstart=0#5512963</link>
      <description>&lt;!-- [DocumentBodyStart:a821c2de-2382-422e-b1cc-20a92e8273f2] --&gt;&lt;div class="jive-rendered-content"&gt;&lt;p&gt;to retain previous value while being used between parent &amp;amp; child symbol ?&lt;/p&gt;&lt;/div&gt;&lt;!-- [DocumentBodyEnd:a821c2de-2382-422e-b1cc-20a92e8273f2] --&gt;</description>
      <pubDate>Wed, 17 Jul 2013 12:10:55 GMT</pubDate>
      <author>forums_noreply@adobe.com</author>
      <guid>https://forums.adobe.com/message/5512963?tstart=0#5512963</guid>
      <dc:date>2013-07-17T12:10:55Z</dc:date>
      <clearspace:dateToText>1 year 4 months ago</clearspace:dateToText>
      <clearspace:replyCount>9</clearspace:replyCount>
      <clearspace:objectType>0</clearspace:objectType>
    </item>
  </channel>
</rss>

