apache-flexurlhrefnavigatetourl

flex 4.6 set browser url like window.location for pages within same base url


flex 4.6

seems like a noob Q. but I would like to change the browser url page not domain, from http://myUrl.com/page1 to http://myUrl.com/page2. I have tied IBrowserManager .setFragment(page2) this seems to add to the existing url http://myUrl.com/page1#page2.

Is there a way to do this?

I am looking to do two things,

  1. reset the application to its load state if the user logs out or session ends etc - ie reload the page and start again http://myUrl.com/page1
  2. as the site will not be updated in one go, if the user reaches the end of the app and needs to navigate to a html page from the app loaded via page1 http://myUrl.com/page2.

Thx Art


Solution

  • BrowserManager is supposed to manage application states and support inner history of Flex application. setFragment method controls only url part after #, which actually doesn't reload the page. What you need is navigateToURL function.

    navigateToURL("http://myUrl.com/page2", "_self");