10 Replies Latest reply on Jul 5, 2006 6:09 PM by ntsiii

    Can't browse to MXML files?

    Ryan Stille Level 1
      I am new to Flex. I've installed the Flex Data Services and the ColdFusion MX 7 updater 2 on my server (windows 2k).

      But when I browse to my sample .mxml file in my web browser (firefox), I just get prompted to save the file to my computer - the server isn't rendering it. I am able to compile the mxml file on my local machine using mxmlc.exe, but I thought I was supposed to be able to just browse directly to the files, too, and have the server compile it into flash?
        • 1. Re: Can't browse to MXML files?
          JFAM
          Browse to the sample using an http://yourserver:port/context/sample.mxml.
          I hope this helps.
          • 2. Re: Can't browse to MXML files?
            Ryan Stille Level 1
            That helped a little, it made me remember something about starting a built in server, so after a little research I went to the Start menu and ran "Start Integrated Flex Server'. Then I was able to browse to port 8700 of my webserver, and pull up some of the *.mxml demo files.

            But how do I get it setup so I can just place mxml files on my regular webserver (IIS) and browse to them and have Flex compile them into SWF files?
            • 3. Re: Can't browse to MXML files?
              JFAM Level 1
              Flex Data Services is a java webapp (a WAR), so you need to deploy it onto a J2EE server. Flex Integrated Server is a JRun server, with flex webapp already deployed. if you want IIS forward the HTTP request sto the appropriate application server, you will need a connector (i.e. IIS/JRun 4 connector).
              Actually, the "integrated flex server" is oriented to development purposes, if you only want to evaluate flex, there is no need to make a production set-up (IIS - J2EE - Flex).
              • 4. Re: Can't browse to MXML files?
                ntsiii Level 3
                Are you confusing 2.0 with 1.5? 2.0 does not compile mxml into swfs. you must compile the mxml yourself using either Flex Builder 2.0 or the command line compiler. To run a Flex app, you must call the html file that hosts the Flash Player.

                Tracy
                • 5. Re: Can't browse to MXML files?
                  Ryan Stille Level 1
                  I am using Flex 2. I've used the command line compiler, but it can also compile for you when you request a *.mxml file through the web server. Maybe this feature is only intended for development though?
                  • 6. Re: Can't browse to MXML files?
                    ntsiii Level 3
                    "but it can also compile for you when you request a *.mxml file through the web server"

                    Can you point me to where this is covered in the documents? I frankly do not believe it, but am prepared to be proven wrong.

                    Tracy
                    • 7. Re: Can't browse to MXML files?
                      inlineblue Level 1
                      quote:

                      Originally posted by: ntsiii
                      Are you confusing 2.0 with 1.5? 2.0 does not compile mxml into swfs. you must compile the mxml yourself using either Flex Builder 2.0 or the command line compiler. To run a Flex app, you must call the html file that hosts the Flash Player.


                      Actually, FDS does retain the capability of compiling your applications on-the-fly on the server. I haven't used that capability, though, so I can't be of much help.
                      • 8. Re: Can't browse to MXML files?
                        ntsiii Level 3
                        Actually reading JFAM's post, I probably am wrong. But I am sure the "Integrated flex server" is legacy and is not intended for production. I am still interested in where the docs cover this.
                        • 9. Re: Can't browse to MXML files?
                          Ryan Stille Level 1
                          quote:

                          Originally posted by: ntsiii
                          "but it can also compile for you when you request a *.mxml file through the web server"

                          Can you point me to where this is covered in the documents? I frankly do not believe it, but am prepared to be proven wrong.

                          Tracy


                          From the flex2_gettingstarted.pdf document:

                          Working with a web server
                          Your development and deployment environments typically include a web server, where you
                          use the web server to return a Flex SWF file in response to a user request. You use one of the
                          following types of web servers:
                          ■ Simple web server
                          A simple web server only responds to static page requests to simple HTML pages. In this
                          case, you precompile your Flex applications and write a wrapper that embeds your Flex
                          application’s SWF file in an HTML page.
                          56 Building a Flex Application
                          ■Web application server
                          A web application server, such as JRun, ColdFusion, or PHP, can dynamically generate
                          pages that host your Flex applications. In this case, you can take advantage of the
                          application server’s available tag libraries and processing language to dynamically create a
                          wrapper for your Flex application. However, you must precompile your Flex application
                          before deploying it to this type of server. You can use any type of server, and not just a Java
                          application server, to serve up Flex applications, as long as you precompile that application
                          and that application does not use the services available with Flex Data Services.
                          ■ J2EE application server or servlet container
                          You require a J2EE application server or servlet container, such as JRun, Tomcat, or
                          WebSphere, to run Flex Data Services. You typically precompile your Flex applications
                          before deploying them on a server running Flex Data Services. However, during
                          development you can request a Flex application’s MXML file in the browser to compile
                          the Flex application at run time. This invokes the web-tier compiler which generates a
                          wrapper and returns a compiled SWF file.
                          • 10. Re: Can't browse to MXML files?
                            ntsiii Level 3
                            Thanks!

                            Tracy