Skip to main content
November 14, 2016
Answered

sym.setVariable Not working (HTML5)

  • November 14, 2016
  • 1 reply
  • 280 views

I am trying to set a global variable for a loop and the code 'sym.setVariable' isn't working. The browser error is 'sym' is not defined.

I tried this.setVariable also but the error is setVariable is not a function.

Is that still the way to do it in the lastest version?

I'm setting it in the first frame of the project.

    This topic has been closed for replies.
    Correct answer

    Nevermind, this works for and I can still access the var on another frame. I guess I was resetting the var on each loop.

    if (!this.looped) this.looped = 0;

    if (this.looped++ > 3) this.stop();

    1 reply

    Correct answer
    November 14, 2016

    Nevermind, this works for and I can still access the var on another frame. I guess I was resetting the var on each loop.

    if (!this.looped) this.looped = 0;

    if (this.looped++ > 3) this.stop();