1 Reply Latest reply on Nov 30, 2009 8:32 AM by nikos101

    Flex 4.0.0.10485: strange RemoteObject behaviour

    pejaham

      The following code snippet only works when used within the script block of the main <s:Application> tag - when I use it within an ActionScript class (i.e. a proxy class), I get server errors:

       

              import mx.rpc.AsyncResponder;
              import mx.rpc.AsyncToken;
              import mx.rpc.events.ResultEvent;
              import mx.rpc.remoting.mxml.RemoteObject;

       

              var remoteObject:RemoteObject = new RemoteObject("echoAmfService");
              remoteObject.endpoint = "http://myserver:8080/blazeds/amf";
              var token:AsyncToken = remoteObject.echo("Test");
              token.addResponder(new AsyncResponder(resultHandler, faultHandler, token));

      So the <s:Application> must either do something under the hood or it is a bug in Flex 4. Any idea?

       

      Thanks and Regards,

      Peter