Refresh(F5) Handling in Flex application

Problem : Refresh(F5) Handling in Flex application

Description : Are you facing problem with the Refresh(F5) option available in the browser for your flex application.Here is the solution for this.The Refresh is a good option to reload the page again.But in Flex/Flash(swf) file it reloads the view as it was started.

Project Demo :

Download : Download the Refreshing flex project source here

Description:

  • I used the Shared Object to store the values when the user is valid.
  • In this example i have 2 container one for Login and other one for display user information put it inside ViewStack.
  • so the login name and password is megharaja.
  • Created single ton instance for Shared Object and also created shared object with the name “sampleData”.
  • So when the user is valid i will store the value in shared object as localSharedObject.data.userStatus = “validUser”;
  • When user hits Refresh/F5 key it calls initApplication() method then it checks shared object with the data (userStatus).If it returns value then it means the user is already logged in we can directly jumps into next screen of the user.
  • We can clear the shared object value when the user click on the Log off.

Share and Enjoy:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks

Speak Your Mind

Tell us what you're thinking...
and oh, if you want a pic to show with your comment, go get a gravatar!

SEO Powered by Platinum SEO from Techblissonline