Xml socket IOerror

hiyall,

i plan to make an AS3 package to communicate with processing with flash, but it seems i cant even get xml sockets to run. i’d like to know if it’s AS3 related or if related to my network (cuz im not really good with networks)

here is what i did

package {
    
    // imports
    import flash.display.Sprite;
    import flash.net.XMLSocket;
    import flash.events.Event;
    import flash.events.DataEvent;
    import flash.events.IOErrorEvent;
    
    
    // class definition
    public class Main extends Sprite {
        
        // variables
        var socket:XMLSocket;
        
        
        // constructor
        public function Main () {
            
            socket = new XMLSocket ();
            socket.connect ("127.0.0.1", 9002);
            
            socket.addEventListener (DataEvent.DATA, xmlSocketDataHandler);
            
            socket.addEventListener (Event.CONNECT, xmlSocketEventsHandler);
            socket.addEventListener (Event.CLOSE, xmlSocketEventsHandler);
            socket.addEventListener (IOErrorEvent.IO_ERROR, xmlSocketEventsHandler);
            
        }
        
        
        // events
        private function xmlSocketEventsHandler (event:Event):void {
            
            trace (event);
            
        }
        
        
        private function xmlSocketDataHandler (dataEvent:DataEvent):void {
            
            trace (dataEvent);
            
        }
        
        
        // functions
        
        
    }
    
}

whether i use the loneliest number or the ip i get from my ipconfig (i work on windows xp) i get an IOerror

any help is appreciated!

i have many ports, i have set a loop so that every time an attempt fails, i increment the ort numbe and try again. i let it run for the whole day but to no avail.

i have looked around for this, and i think it might be related to the security additions done to the new flash player.

i read a bit about xml socket policy files (http://www.adobe.com/devnet/flashplayer/articles/fplayer9_security_04.html, http://blog.je2050.de/2005/10/26/how-to-use-sockets-in-actionscript3/) but it is not clear how i can use that locally.

i am not trying to open a port to some other computer, or even via a browser, so then do i need such a file?

To be honest, I’m not sure anymore about the local file system security.

Are you testing in the IDE, the standalone player, or the browser? Each has different security issues.

I would suggest you set up a simple security server on the appropriate port and see if it solves your problem. Or at least serve the cross-domain xml file from your main server on your first connect.

i am testing directly into the ide to eventually have it in a standalone player. i do not want to deal with a browser since i plan this for installations. the connection will be between flash and other softwares such as max/msp/jitter, processing and possibly supercollider.

i tried with both a windows xp pc (at home) and a mac os x (at work) and i get the same answer. ill try uploading the cross-domain xml to my server, but i find this pointless since my installations wont conenct to another computer or even the internet in the end…

Check out this thread, I think your situation is similar:

http://www.kirupa.com/forum/showthread.php?t=296180&highlight=socket