Skip to main content
dariuszk32546812
Inspiring
March 22, 2017
Question

getVariable() stopped working

  • March 22, 2017
  • 1 reply
  • 976 views

JavaScript in a HTML file:

<script type="text/javascript">

<!--

    var flashMovie;

    var movieID = 'movie_name';

    flashMovie = document.getElementById(movieID);

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

//-->

</script>

HTML:

<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

in:

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.

This topic has been closed for replies.

1 reply

kglad
Community Expert
Community Expert
March 22, 2017

GetVariable != getVariable

dariuszk32546812
Inspiring
March 22, 2017

GetVariable is correct:

TypeError: flashMovie.getVariable is not a function

kglad
Community Expert
Community Expert
March 22, 2017

actually, i don't see either one as part of the javascript spec, JavaScript methods index - JavaScript | MDN