Skip to main content
Participant
January 5, 2021
Question

Beginner Q - How to keep states in a project

  • January 5, 2021
  • 1 reply
  • 274 views

Hi

I am evaluating animate as a potential tool for making our online games / puzzles. So I should say I dont know much about animate yet. 

Is there anyway to keep states of the project for a user, between sessions? For example, if a user progresses in a project, and gets to a certain point in the game, or certain variables are set, if they restart or come back at a later time, is there any state saved, or anyway to save it? Is that built in, or have to do with javascript and cookies? (I know just enough about javascript to know thats an option in theory)

    This topic has been closed for replies.

    1 reply

    JoãoCésar17023019
    Community Expert
    Community Expert
    January 5, 2021

    Hi.

     

    There's no specific APIs for data storage in Animate.

     

    The code written in HTML5 documents is pure JS + the CreateJS API to handle graphics and animations created in the IDE that are exported without compilation/transpilation.

     

    So what I can recomend to you is to use JavaScript's sessionStorage API or a BaaS like Firebase, if you are not a backend developer, like me.

     

    Regards,

    JC

    Participant
    January 6, 2021

    Hi JC

     

    Thanks for your help. Everything you said there is new to me! So I'm guessing a bit what that all means! Is what you are describing here relatively easy for a technical person, without being an expert in coding? I assume that JS session storage is a server side module running on a webserver (all servers?). If it kind of works OOTB with just some API commands like, please save this session state, then it sounds good.

    If it requires lines of debugged code to get one button to retain its state, then I think I will be unable to do it on my own.

    Participant
    January 6, 2021

    Update - sorry just looked at JS Session Storage. I see it's client side, like a turbo cookie. 

     

    Have you any experience with BaaS saving states for Animate project? Would that be easy to get going with?

    Dave