Skip to main content
Participating Frequently
May 5, 2023
Resuelto

Converting AS to html5 - changing variable within movieclip

  • May 5, 2023
  • 4 respuestas
  • 485 visualizaciones

Hello,

I have an old Flash ActionScript game I would like to convert to html5.

In a movieclip, I would change a variable located in the root using:

_root.heroStatus = "movingRight";

How would I do the same in html5?

Thanks

    Este tema ha sido cerrado para respuestas.
    Mejor respuesta de JoãoCésar17023019

    Hi.

     

    One of the ways of doing this is to use the global exportRoot variable that is generated automatically in the publishing process. Like this:

    exportRoot.heroStatus = "movingRight";

     

    I hope this helps.

     

    Regards,

    JC 

    4 respuestas

    JoãoCésar17023019
    Community Expert
    Community Expert
    May 5, 2023

    Hi.

     

    One of the ways of doing this is to use the global exportRoot variable that is generated automatically in the publishing process. Like this:

    exportRoot.heroStatus = "movingRight";

     

    I hope this helps.

     

    Regards,

    JC 

    garydgAutor
    Participating Frequently
    May 5, 2023

    Thanks! I will try this. Does this only work when I publish, or will it work when I test in Animator too?

     

    kglad
    Community Expert
    Community Expert
    May 5, 2023

    it will work during testing, too.