haXe Forum > flash IDE swf <---> Neko Server

  • I'm dealing with difficulties trying to make things work between flash IDE swf and haxe/neko.
    I need a little help.
    My URLrequest to a neko server page does not answer well.
    Here is the flash IDE source :

    //Test.as
    var loader:URLLoader = new URLLoader();
    var there:String = 'http://localhost:2000/server.n';
    var request:URLRequest = new URLRequest(there);
    var vars:URLVariables = new URLVariables();
    vars.x = "10";
    vars.y = "5";//
    ...
    trace(event.target.data.toString())

    //server.hx
    class Server {
    public static function main() {
    var server = new neko.net.RemotingServer();
    server.addObject("Calc", new Calc());
    if(server.handleRequest())
    return;
    // handle other requests (not remoting)
    neko.Lib.print("Neko remoting server waiting for a request");
    }
    }

    class Calc {
    public function new() { }
    public function sum(x : Int, y : Int) : Int {
    return x + y;
    }
    }

    whatever I try with the falsh IDE, I only receive :
    "Neko remoting server waiting for a request"
    Everything is OK if I use a Haxe swf.
    Could you tell me how the things have to be done ?

< Prev | Page 1 / 1 | Next >