0

I'm trying to create an app that multiple users would log into a server hosted over the local network. When testing the app in Flash Builder it connects, but when I run it on my phone it does not.

I'm using XMLSocket like so:

        private function connect(event:MouseEvent):void {           
            xmlSck = new XMLSocket();
            xmlSck.addEventListener(Event.CONNECT, onConnect);
            xmlSck.addEventListener(SecurityErrorEvent.SECURITY_ERROR,onSecurityError);
            xmlSck.addEventListener(IOErrorEvent.IO_ERROR,onIOError);
            Security.loadPolicyFile("xmlsocket://http://manbearpig.org/dev/flashpolicy.xml");
            xmlSck.connect("127.0.0.1", 8080);
        }

I'm not really sure about the policy file, I just threw it in there hoping that might do something.

Here's a video to illustrate what I mean

blakeaholics
  • 100
  • 10

1 Answers1

1

You need to replace the ip address on this line:

xmlSck.connect("127.0.0.1", 8080);

To be the IP address of your computer. 127.0.0.1 is the loopback address, I am guessing you do not have a server running on your phone :)

Sunil D.
  • 17,983
  • 6
  • 53
  • 65
  • Well I've tried 192.168.127.1 which is currently my computer's IP and no dice. Any ideas? Same error is thrown. – blakeaholics Apr 02 '12 at 06:53
  • Try and rule out that it's not a network connectivity issue. Hard to read the error from your video :) For example, I've seen wifi routers not allow access to local web servers that were also on wireless. Try and bring up a web page from your java server on your phone's browser, etc. – Sunil D. Apr 02 '12 at 06:59
  • Oh its not that kind of server. I'm just running a java app and using ServerSocket to communicate with the android app. It says its an io error. #2031 but that seems it could be anything to me. – blakeaholics Apr 02 '12 at 07:12