Take the 2-minute tour ×

I must say that I am reaching the end of my tether with Flash Builder and Flex. Firstly, I have built this wonderful app that I want to start using but it is data driven meaning that when I built it, I created it on my localhost. The PHP scripts were generated from Flash Builder and I have edited them to make them more secure. I have all my services working 100% and I have this brilliant app, but I can only run it on localhost. I have done everything necessary and installed Zend Framework on both servers, I have configured Zend properly but I cannot work out how to change the mobile app to now read from my remote web server.

To me this is useless as I want to be able to deploy this app to others to use when they are out and about.

Does anyone have any clue whatsoever as to how to change it from looking at a localhost to looking to my remote web host? Any tutorials or anything that you can think of? Any help would be appreciated.

share|improve this question
add comment

1 Answer

up vote 2 down vote accepted


Usually, I don't have to do anything. It just works. But, for some reason, the "first migration" from localhost to production seems to be hard for every Flex developer. Here are some things I wrote about that frustrated me.

Before moving forward; I'll add that your post is inherently confusing. You talk about running your app on localhost; but you also talk about building mobile apps. Were you building a native mobile app? If so; how are you running it on localhost? Mobile Native Apps don't run on a local web server; they run in an emulator.

The rest of this post assumes you are building a browser based app, but even if not should give you some good debugging tips.

Most likely you did something ignorantly which is preventing things from working. Once you figure it out you'll never have the problem again. So, here are some things to check:

It sounds like you have URLs hard coded somewhere within your app that point to localhost. I'd look for that first.

If you're using AMF with RemoteObject; it may be in your services-config file that is hard coded into your app. Be sure to check that if you are compiling a services-config into your app.

Beyond that, it is possible that your remote server is not configured properly. When using ColdFusion we have a special URL ( localhost/flex2gateway ) that we can check to verify that Flash Remoting is set up properly. I'm not sure about PHP, but I bet it is something similar.

You didn't tell us your specific setup, but if you're using a locahost SWF with services on you remote server, your remote server will need a crossdomain.xml file to allow the "off-server" access.

You didn't tell us your specific error, which makes it hard to provide more information. But, be sure to test your services--outside of the Flex app--to make sure they don't have remote errors. Be sure to check case sensitivity of URLs on your localhost vs your server. Be sure to use a Network Sniffer such as the Flash Builder Network Monitor to or ServiceCapture or Charles to check the traffic being sent from the browser/Flash Player to your server. You may discover errors that way.

share|improve this answer
Hey there, sorry if my post was confusing. I have just been trying to get this work for almost a month now and still to no avail. Anyway, I am able to run my app on my mobile device if I set my Flex server to my PC's IP address instead of localhost. I got that from one of the Flex evangelists. This however doesnt work for remote because you have to set the web root as well. The other thing I see you mentioned was the services-config file. I have heard of that alot but I do not have it in my application folder at all. Where could I find or install this from, maybe that is causing trouble. –  JESLAB Mar 19 '12 at 13:21
@JESLAB There hasn't been a Flex Server for many years; so I'm not sure what you're setting. You're going to have diagnose your issue to figure out what the actual error is before I can offer additional help. I believe I provided many things to look at to help find the real issue. –  Reboog711 Mar 19 '12 at 15:07
Hey @www.Flextras.com I ran some of the tests you mentioned and I found that it is indeed looking at my server but it is failing to connect correctly and in Network monitor it gives the error of Channel.Connect.Failed error NetConnection.Call.Failed:HTTP: Status 500 –  JESLAB Mar 19 '12 at 15:24
@jeslab There you go; a 500 status means there is a problem with the URL that your Felx app is trying to access. Generally it means "page not found". So you need to revisit server configuration. –  Reboog711 Mar 19 '12 at 16:17
This was the correct answer! Sorry it has taken me so long to respond, but I have been going through it on a daily basis and decided to get some books on it. Anyway, after going through several linking solutions such as Coldfusion, WebORB, REST etc I came back to this one to find that just fixing up my Zend installation was my biggest problem. I specifically had to look at where my library folder was sitting as well as my AMF_Config and Gateway files which were wrong. I had thought I had set them correctly but I was 1 level short. –  JESLAB Apr 22 '12 at 13:45
add comment

Your Answer


