質問

I'm beginner in Flex mobile application , my issue when using flex mobile application that interact with services with asp.net i try to load URLString in flex mobile application ,but it always go to NoConnection function when i use break point and the mobile is connected to the internet this is my code

                protected function Submit():void
        {

            SendLoader = new URLLoader();
            var URLString:String ="http://localhost:1614/Master_Services/Problems/insertProblem.aspx";
            SendLoader.addEventListener(IOErrorEvent.IO_ERROR,NoConnection);
            SendLoader.addEventListener(HTTPStatusEvent.HTTP_STATUS,httperror);
            SendLoader.addEventListener(Event.COMPLETE,SendComplete);
            SendLoader.load(new URLRequest(URLString));

        }

update : this URL worked well in the computer browser , but in mobile browser it couldn't load and give me web Page not available . I think this may the problem , if this the problem , Any idea to load url placed in localhost in moblie while Im debuging via USB .

Please help , Thanks in advance

役に立ちましたか?

解決

You need to change localhost to your computer's IP address. In the mobile browser, your code is trying to connect to port 1614 on the device instead of port 1614 on your development computer.

Also make sure that your firewall is configured to allow requests to come in to that port; it's an easy step to miss. You might need to deploy your code to IIS on your computer to make this work, too. The built-in webserver for Visual Studio will only work from localhost (see Can't access Visual Studio project from IP, only http://localhost).

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top