2 Replies Latest reply on Jan 13, 2007 11:03 AM by wilsoneto

    FlashRemoting ActionScript Error

    wilsoneto
      Hello, I'm trying to use the Flash Remoting from Flash8 to access Java Stuff, But the action script in the .fla file always shoms me as an error:
      Code:
      import mx.remoting.*;

      // connect to the gateway server
      if (inited == null) {

      inited = true;
      NetServices.setDefaultGatewayUrl(" http://localhost:8081/PrintService/gateway");
      gatewayConnnection = NetServices.createGatewayConnection();
      flashtestService = gatewayConnnection.getService("JavaPrinter", this);
      }

      // call the service function getMessage()
      flashtestService.printTicket();

      // use _Result to have Flash call this function
      function printTicket_Result(result) {
      messageOutput.text = result;
      }

      // use _Status to handle any errors
      function printTicket_Status(result){
      messageOutput.text = "status: " + result.details;
      }

      myFile.fla Error:
      **Error** Scene=Scene 1, layer=Layer 1, frame=1:Line 1: Syntax error.
      import mx.remoting.*;

      Total ActionScript Errors: 1 Reported Errors: 1

      The NetServices.as file is located at: C:\Arquivos de programas\Macromedia\Flash 8\en\First Run\Classes\mx\remoting