first ,thanks your greate lib. and my problem is .
code like
//////// from
var url:String = "http://localhost:8080/index.n";
var c:AMFConnection = AMFConnection.urlConnect(url);
c.setErrorHandler(onError);
//var IC
c.HelloService.hello.call(["one", "two"], onResult);
////
to:
typedef Obj ={
i:Int,
s:String,
}
typedef Hellox = {
function hello(x:String, y:String):String;
function getLength(data:Array < String>):Int;
function getObject(obj:Obj) :String;
function getClass(p:Bytes):Dynamic;
}
typedef FwdTarget = {
function onError(e:Dynamic):Void;
function onResult(r:Dynamic):Void;
}
class Forwarder implements Cls {
var fields:Hash = new Hash();
@:forward(!multiply) var target:FwdTarget;
@:forward function fwd2(z:Hellox) {
get: fields.get($name),
set: fields.set($name, param),
//call: trace('calling '+$name+' on '+$id+' with '+$args)
call: trace('calling '+$name+' on '+$id+' with '+$args),//how to rewrite this line the same as
}
var c:AMFConnection;
function callRemoting(name, id, args):Void {
//c.HelloService.hello.call(["one", "two"], target.onResult);
}
public function new(target) {
this.target = target;
var url:String = "http://localhost:8080/index.n";
c = AMFConnection.urlConnect(url);
c.setErrorHandler(target.onError);
}
}
I don't know how to write call: in @forwart ?
call: trace('calling '+$name+' on '+$id+' with '+$args),//how to rewrite this line the same as
c.HelloService.hello.call(["one", "two"], onResult);
any idea?
first ,thanks your greate lib. and my problem is . code like
//////// from var url:String = "http://localhost:8080/index.n"; var c:AMFConnection = AMFConnection.urlConnect(url); c.setErrorHandler(onError); //var IC c.HelloService.hello.call(["one", "two"], onResult);
//// to:
typedef Obj ={
} typedef Hellox = { function hello(x:String, y:String):String; function getLength(data:Array < String>):Int; function getObject(obj:Obj) :String; function getClass(p:Bytes):Dynamic; } typedef FwdTarget = {
} class Forwarder implements Cls { var fields:Hash = new Hash();
@:forward(!multiply) var target:FwdTarget;
}
I don't know how to write call: in @forwart ? call: trace('calling '+$name+' on '+$id+' with '+$args),//how to rewrite this line the same as c.HelloService.hello.call(["one", "two"], onResult); any idea?