4 Replies Latest reply on Oct 24, 2006 5:21 PM by ntsiii

    New Window

    ForsakenBlade Level 1
      When a variable is met or a button is clicked how would you make another file open?

      I have the main file which is a login (not functional yet) but I would like to know when the user is logged in it would set a variable to true and then open another file which would be something like status.mxml. How would I have that then show instead of the login or show in a new window.
        • 1. Re: New Window
          leotemp Level 1
          well you would be moving the client from your current application which is a swf embeded in an html file or other web document, You want to use "navigateToURL" to open another browser pointed at the doc that has your "status.swf" embeded in it.

          As far as triggering the open timed to the completion of the first window just put

          creationComplete="{nameOfFunction()}" in your application tag, nameOfFunction being the name of your function using navigateToURL to open another browser window.
          • 2. Re: New Window
            ntsiii Level 3
            leotemp's suggestion will work, but I suspect you have not fully grokked the Flex RIA paradigm.

            Typical Flex apps never change windows, never call an url to display a ui (except the first time, of course). Flex is not "page" based like html.

            You can achieve what you describe using ViewStack or TitleWindow, or other container, or "states". The login screen is just a component of the main app and is displayed or hidden as needed.

            Don't build an html style app with flex, you lose much of the benefit, like state on the client.

            And this is not a Flex Builder question. It should go in General Discussion.

            • 3. Re: New Window
              ForsakenBlade Level 1
              but If it wasn't ment to change windows then in a Project whats the point of having divverent .mxml files if all you need is one?
              • 4. Re: New Window
                ntsiii Level 3
                "...whats the point of having different .mxml files..."

                Extensibility, re-use, maintainability, readability, etc.

                In 1.5 there was the 32k limit, but that is gone in 2.0.

                There is no technical reason you can't have everything in a single mxml file.

                But if you did that and you worked for me, I'd fire you.