0 Replies Latest reply on Jul 6, 2010 10:43 AM by DavidSuix

    Socket access blocked only for trusted files in AS2...




      I'm making a new post because I'm facing a very strange situation. I've tested it for 10 days, have reproduced the problem on several computers and for several Flash Players version, and I do wonder if this isn't a bug in the last versions of Flash Player.


      I've got a simple code just connecting to a server via an XMLSocket. Swf file and server are local on the same computer. The code is written in AS2.

      On the computer, I've got a correct socket policy file server on port 843.


      The code is this :

      var socket:XMLSocket;
      socket = new XMLSocket();
      socket.connect("", 23448);
      socket.send("do your stuff");


      When I run the code in 'test movie', projector or when the swf file is in the global flash player trust sandbox, the swf won't connect to the server via the socket : nothing happens. In those 3 cases, the file is supposed to be trusted.


      When the swf file is placed in the local-with-network sandbox only, Flash Player will call the policy file server and let the socket connect to the server.


      If I take the exact same code but compile it as AS3, it's working the other way round: trusted files can connect to the server, and local-with-network file won't. This is the logical behavior and makes sense.


      Has anyone any idea of where this might come from? Isn't there an inversion somewhere and a bug between the 2 virtual machines running respectively AS2 and AS3?


      I would really appreciate your help,


      Thank you.