Hi, we have socket server running port 80, I need get a policy file through: System.security.loadPolicyFile("xmlsocket://213.32.122.227:80");
The following class does work offline, but not online. How am I supposed to debug this, as the System method to load the policy file has no callback. Has anyone experience with loading a policy file from and connecting to port 80? Thanks, Michael import com.dynamicflash.utils.Delegate; import mx.events.EventDispatcher; import org.aikane.Aikane; import auktion.Auktion; /** * AuktionConnector * * @author Michael Nisi ([EMAIL PROTECTED]) * @version 0.0.0 22.05.2006 */ class auktion.business.AuktionConnector { private static var instance:AuktionConnector; private static var socket:XMLSocket; private static var waitID:Number; private static var isConnected:Boolean; public static var CONNECT_EVENT:String = "connect"; public static var CLOSE_EVENT:String = "close"; public static var DATA_EVENT:String = "data"; public static var XML_EVENT:String = "xml"; private function AuktionConnector(Void) { EventDispatcher.initialize(this); socket = new XMLSocket(); socket.onConnect = Delegate.create(this, onConnect); socket.onXML = Delegate.create(this, broadcast, XML_EVENT); socket.onClose = Delegate.create(this, onClose); } public static function getInstance(Void):AuktionConnector { Aikane.log("auktion.business.AuktionConnector", "getInstance: "+instance); return instance || getNewInstance(); } private static function getNewInstance(Void):AuktionConnector { instance = new AuktionConnector(); return instance; } public function dispatchEvent(event:Object) {} public function addEventListener(type:String, listener):Void {} public function removeEventListener(type:String, listener):Void {} public function connect(host:String, port:Number):Void { Aikane.log(toString(), Auktion.POLICY_FILE); System.security.loadPolicyFile("xmlsocket://213.32.122.227:80"); socket.connect(host, port); clearInterval(waitID); waitID = setInterval(this, "onConnect", 5000, false); } public function send(xml:XML):Void { socket.send(xml); } private function onConnect(success:Boolean, delegate:Function):Void { Aikane.log(toString(), "onConnect"); clearInterval(waitID); if (success) { broadcast(success, CONNECT_EVENT); } else { broadcast(null, XML_EVENT); } } private function onClose(e, delegate:Function):Void { Aikane.log(toString(), "onClose"); } private function broadcast(data:Object, type:String, delegate:Function):Void { Aikane.log(toString(), "broadcast"); dispatchEvent({ type:type, data:data, target:this }); } private function toString(Void):String { return "auktion.business.AuktionConnector"; } } _______________________________________________ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com