Dear all,
dear al,

with as2 remoting you must / can / may :) use the Responder Object.
All you need to do is to pass the Responder as the second parameter for your Service constructor
like so :

// responder class
class MyResponderSubclass extends mx.remoting.Responder { // please check the package , i am not really sure but the class name is correct
        public function MyResponderSubclass() {}

        public function onResult() { .... }

        public function onStatus() { .... }

        // private methods .....

}

this.service = new Service(this.gatewayUrl, new MyResponderSubclass() , "myservice");

or

var responder:Object = new Object();
responder.onResult = function() { ... code here ...  } ;
responder.onStatus = function() { ... code here .... } ;

this.service = new Service(this.gatewayUrl,  responder , "myservice");

By the way, its kinda best practice to NOT attach event handlers and other 'utililty Objects' directly to root. Better refactor them out to Helper classes or even better write a NetConnection Subclass and a NetConnection Responder subclass and handle all events in there. O'Reilly's Essential Flash Remoting is a great place to learn all about remoting, which by the way rocks !!!!

Hope I could help you. If anybody finds a flaw in the code, please forgive and correct me. Its been quite a long night.

Live long and prosper :)

amirrocker.de


Am 11:22 AM 5/24/2007 schrieben Sie:
Hi to all,

i've tried to google to obtain a solution, but no way...

how can I catch STATUS events generated by the remoting connector?

with AS 1 remoting:
_root.conn = NetServices.createGatewayConnection(_root.globals.amfGateway);
_root.myService = _root.conn.getService("myservice", this);
_root.conn.onStatus = function(error) {
        // code here
};

how should I do this within a class and with the actual AS2 syntax

this.service = new Service(this.gatewayUrl, null, "myservice");

i've find a PATCH to AS classes, but I think It's not a great idea... maybe there is a smarter way

Thanks in advance

Alfonso Florio

_______________________________________________
[email protected]
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

_______________________________________________
[email protected]
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

Reply via email to