To save the variable between layouts and store for closing and reloading:
On End of Layout - Local Storage: Set Item Key: "variablewhatever", Value: "sprite.variable"
On Start of Layout - Local Storage: Check Item "variablewhatever" exists
Local Storage: On Item "variablewhatever" exists - Get item "variablewhatever"
Else: Set Sprite AnimationFrame to 0
Local Storage: On Get Item "variablewhatever" - Set Sprite.animationframe to LocalStorage.ItemValue