SHOW:
|
|
- or go back to the newest paste.
| 1 | import flash.events.DataEvent; | |
| 2 | import flash.events.Event; | |
| 3 | import flash.events.IOErrorEvent; | |
| 4 | import flash.net.XMLSocket; | |
| 5 | - | import flash.system.Security; |
| 5 | + | |
| 6 | class Main extends Sprite | |
| 7 | - | class Socket extends XMLSocket {
|
| 7 | + | {
|
| 8 | public static function main(): Void | |
| 9 | - | private var main: Test; |
| 9 | + | {
|
| 10 | var s = new XMLSocket(); | |
| 11 | - | public function new(test: Test): Void {
|
| 11 | + | s.addEventListener(Event.CONNECT, function(e) trace e); |
| 12 | - | super(); |
| 12 | + | s.addEventListener(Event.CLOSE, function(e) trace e); |
| 13 | s.addEventListener(IOErrorEvent.IO_ERROR, function(e) trace e); | |
| 14 | - | main = test; |
| 14 | + | s.addEventListener(DataEvent.DATA, function(e) trace e); |
| 15 | - | Security.loadPolicyFile('policy.xml');
|
| 15 | + | s.connect('localhost', 2000);
|
| 16 | - | |
| 16 | + | |
| 17 | } |