This content has been marked as final. Show 4 replies
Yes it will start over b/c your app uses flash player. Your entire application resides on one web page. Even if it were in html, if someone hit the refresh button, the page starts over. That's what it is there for.
Is there a way to prevent this, in a sense if the user is on a screen in my app, if they hit refresh I'd like to keep them on that same screen. Is this possible?
Use the SharedObject as a cookie to save state:
public var userSharedObject:SharedObject;
userSharedObject = SharedObject.getLocal("idnameforSO"); // read
myViewStack.selectedIndex = userSharedObject.data.currentpage // read
userSharedObject.data.currentpage = 3; // assign new value
userSharedObject.flush(); // write
Set up some logic in your creationComplete event handler to determine if the user has logged-in and what page they were looking at you can even add a time stamp the "expire" the session.
userSharedObject.data.validuser = 0;
userSharedObject.data.time = new Date();
Just remember to update the ShareObject when a user makes a change that you want to track using the flush() method.