|
----- Original Message -----
From: erix tekila
Sent: Tuesday, May 16, 2006 12:19 PM
Subject: Re: [osflash] haXe Remoting (Was:
User Feedback Poll)
>Correct me, but don't pixlib, aswing and actionstep support amf
remoting ?
Yes, you're right, pixlib provides a remoting
framework too.
Its not polymorphic with mx package, that's
totally been redesigned.
ne1 who wanna get the files can dwload them on : http://www.tweenpix.net/tmp/alpha_remoting.rar
here's a basical example :
var service = new TestService("http://localhost/flashservices/gateway.php",
"com.periscope.news.AdminDBRequest");
function test( e : BasicResultEvent
)
{ trace( e.getResult() ); } // typical call
service.addEventListener( TestService.sayMETHOD, this, test ); service.say( "hello" ); // call without method wrapper
service.addEventListener( TestService.sayMETHOD,
this, test );
service.callServiceMethod( TestService.sayMETHOD, "hello"); // one-shot and old-school call without
event-system
service.callServiceWithResponder( TestService.sayMETHOD, new ServiceResponder(this, test), "hello" ); // class example
import
com.bourre.remoting.AbstractServiceProxy;
import com.bourre.remoting.ServiceMethod; import com.bourre.remoting.ServiceResponder; import com.bourre.remoting.TestResponder; class
com.bourre.remoting.TestService
extends AbstractServiceProxy { public static var sayMETHOD : ServiceMethod = new ServiceMethod("say"); public function TestService( sURL : String, serviceName:String ) { super( sURL, serviceName ); } public function say( message : String ) : Void { super.callServiceMethod( TestService.sayMETHOD, null, message ); } } You can override Responder if you need too, here
are 2 different ways :
import com.bourre.remoting.BasicResult;
import com.bourre.remoting.BasicResultEvent; import com.bourre.remoting.ServiceMethod; import com.bourre.remoting.ServiceResponder; import com.bourre.remoting.TestResultEvent; class com.bourre.remoting.TestResponder
extends ServiceResponder { public function TestResponder( scope ) { super( scope ); } /* * 1st override possibility * Override result type. */ public function onResult( rawResult ) : Void { super.onResult( new BasicResult( rawResult ) ); } /* * 2nd override possibility * Override event and result type. */ public function buildResultEvent( rawResult ) : BasicResultEvent { return new TestResultEvent( ServiceResponder.onResultEVENT, new BasicResult( rawResult ), _oServiceMethod ); } } there's some work left, comments are welcome
!
francis |
_______________________________________________ osflash mailing list [email protected] http://osflash.org/mailman/listinfo/osflash_osflash.org
