Here is what I do:
public function logOff():void
{
var ur:URLRequest = new URLRequest(_sAppUrl);
navigateToURL(ur,"_self");
}//logOff
_sAppUrl comes from the browser: location.href
Tracy
________________________________
From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of Aaron Hardy
Sent: Wednesday, December 03, 2008 10:32 PM
To: [email protected]
Subject: [flexcoders] Resetting an application's view for new user
Hey flexers,
I have a hefty AIR application with many different view combinations,
forms filled with data, etc. When a user logs out and a different user
logs in, I need the application to be "reset" so that everything looks
as though no other user was previously logged in. I've ran into two
solutions:
1) Reset all the forms, views, etc to their original state when the
first user logs out. This can be tricky getting everything back to its
initial state.
2) Make the main view (what would be the main application file in option
#1) a separate component. When the user logs out, let the whole
component get garbage collected. When the new user logs in,
reinstantiate the main view to ensure its all in its initial state once
again. With this option, there's not as much worrying about whether
you've successfully reset everything since it's a brand new instance.
However, processing time and memory management may be a new issue to
deal with.
So, I'm curious, how do you folks go about this in your projects?
Thanks!
Aaron