12 Replies Latest reply on Mar 22, 2017 9:48 AM by dariuszk32546812

    getVariable() stopped working

    dariuszk32546812 Level 1

      JavaScript in a HTML file:


      <script type="text/javascript">




          var flashMovie;

          var movieID = 'movie_name';


          flashMovie = document.getElementById(movieID);

          var p = flashMovie.GetVariable("/:p");







      <embed src="movie_name.swf" quality="high" style="width: 625px; height: 416px; background-color: #999999; vertical-align: middle;" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" wmode="transparent" id="movie_name" />


      This stopped working after replacing previous swf file (Action Script 1) by new one (Action Script 3). Replacing "/:p" by "p" or "movie_name.p" doesn't help.

      Variables are declared in:

      Windows - Actions


      Scene1 - Actions: Frame 2

      for example:

      var p:Number = 1;

      The javascript alert() function returns Null or NaN Instead of values of variables. And the variables don't work obviously in the javascript code.