2 Replies Latest reply on May 17, 2007 9:14 AM by James Bower

    Clearing the data on logout

      Hi all,

      Flex newbie here.. I just want to know how to clear the data that i fetched from server on logout. My application have multiple components and each component have different states. Once i logout and login, am getting the previous state before i logout. How to solve this problem? please help me out.
        • 1. Re: Clearing the data on logout
          Vyshak Level 1
          Anybody ter to help me out?
          • 2. Re: Clearing the data on logout
            James Bower
            I'd start with the "loginResultHandler" function and use it to direct the user to a specific component within a ViewStack whenever they login or log back in.

            For example:

            private var currentUser:User = new User();

            private var currentFunction:Function;

            private function loginResultHandler(event:ResultEvent):void {
            currentUser = event.result as User;
            if (currentUser.loggedIn)
            if (currentUser.roles == "admin")
            Alert.show("Login unsuccessful", "Server Authentication");

            This may or may not be the answer you are looking for but it should get you going in the right direction. Check out some of the great Flex tutorials at Lynda.com ( http://movielibrary.lynda.com/html/modListing.asp?pid=205)

            Good luck!