4 Replies Latest reply on Dec 19, 2006 9:14 AM by FlightGuy

    Deploying a Flex Application

    Neus Realone
      I build an RSS Feed Reader Application....I av problem deploying it on another system or directory other than d one in which it was created in by Flex Builder 2..../

      Its really not funny...Isnt flex supposed to be able 2 run like a desktop application leveraging only on d power of Flash Engine installed on any system.../

      D application receives the rss feed link as input n fetches d content into a waiting datagrid control../
      it works perfectly on d default folder (d place it was created in by Flex), but i will like 2 give it 2 someone 2 use../

      pls ow do i get around this../
      Do i need to copy some files or wot.....along wit d project folder../
        • 1. Re: Deploying a Flex Application
          FlightGuy Level 1
          You should be able to deploy just the .swf and any resources/assets that are not embedded into your application. If, however, your RSS feed reader is using HTTPService to access the source, you have to host your swf in a browser. The Flash Engine does not implement the HTTP comms itself, but rather delegates to the host browser (at least this is what I have deduced from attempting similar things in the past).

          Please make an effort to write proper English in your posts - it's really hard work plowing through your 2's D's ow's and lower case i's. If you don't make the effort to write your question properly, people are disinclined to make the effort to answer it.

          • 2. Deploying a Flex Application
            Neus Realone Level 1
            Thanks Tim for your post...
            But its still not working...

            The RSS Feed Reader actually does use the HTTPService...
            On building the application, you know, a project folder will be created...
            Like I said earlier, running the .swf file or the html wrapper loads the application and the HTTPService works as well from here...

            But the HTTPService seems not to work anywhere outside this folder...
            Even when called from another location and hosted on a Browser...

            Is there a security issue somewhere...
            I also read somewhere this morning (or so I think) that the browser has to call the .swf from a web server because of Internet Security Policy(or something funny)...

            I thereafter hosted the project folder on my local coldfusion server and called the .swf directly from the browser...you know what happened...

            Tim could you please try a simple Application that utilise the HTTPService and try running it from another location other than the one created by Flex...

            I have Mid-day as delivery time and would deeply appreciate something speedy.
            • 3. Re: Deploying a Flex Application
              FlightGuy Level 1
              I think you're right - it may be a security issue if your HTTPService is attempting to connect to a url that's not on the same server as the swf. I'll find the doc on it - I did deal with this once before but I need to check for you. Meanwhile, could you add an fault event listener to your HTTPService, and make it show you the event.message.toString - perhaps also the event.fault.faultCode. That will help to nail it down.
              • 4. Re: Deploying a Flex Application
                FlightGuy Level 1
                OK, what you need is a cross-domain policy file on the target domain. You can read about it on page 65 of the flex2_buildanddeploy.pdf document (Building and Deploying Flex 2 Applications). In the root of the target domain you need to create a file called crossdomain.xml, which looks something like:

                // - excerpt from the doc
                <?xml version="1.0"?>
                <!-- http://www.foo.com/crossdomain.xml -->
                <allow-access-from domain="www.friendOfFoo.com"/>
                <allow-access-from domain="*.foo.com"/>
                <allow-access-from domain=""/>

                The domains you list here are the domains from which the swf file may be loaded.

                Now this is not very helpful, I agree, if your goal is to read RSS feeds from various different sources that are not under your control. Perhaps someone else has a suggestion here? I know that FDS can make the connection by proxy from the server, but that's a pricey option if that's all you're using FDS for. Another option would be to run your own Tomcat server or something similar and to proxy to that to acquire the RSS data. If nobody has a better suggestion I'd be happy to walk you through what would be required to do this, but unless you had raw meat and gunpowder for breakfast you're unlikely to have it working by lunch time.

                If you run your swf (and your html) from the file system, rather than through http I believe it suppresses this feature, so for your presentation this afternoon that might be an option.

                I'll keep an eye out on this forum to see if I can help further.