0 Replies Latest reply on Aug 10, 2007 6:18 PM by all_begin

    Flash component

      This is the code i added in my flash movie, first frame (flash 8 professional):

      * This file generated by AMFPHP 1.0
      * You can get AMFPHP to generate code customized to your preferences
      * By modifying the /browser/templates/as2.tpl file

      import mx.remoting.*;
      import mx.rpc.*;
      import mx.utils.Delegate;
      import mx.remoting.debug.NetDebug;

      //Change the gateway URL as needed
      var gatewayUrl:String = " http://PathToMyServer/AMFPHP/gateway.php";
      var service:Service;

      service = new Service(gatewayUrl, null, "PersonService");

      /// interroghiamo il DB
      function getPerson(ageMin, ageMax)
      trace ('in getPerson');
      var pc:PendingCall = service.getPerson(ageMin, ageMax);
      pc.responder = new RelayResponder(this, "handleGetPerson", "handleRemotingError");

      function handleGetPerson(re:ResultEvent)
      trace ('in HandleGetPerson');
      //Implement custom callback code
      trace (re.result.getItemAt(0).label);
      lsPersons.dataProvider = re.result;
      function handleRemotingError( fault:FaultEvent ):Void
      NetDebug.trace({level:"None", message:"Error: " + fault.fault.faultstring });
      function onRetrieve()
      getPerson(nsAgeMin.value, nsAgeMax.value);

      btnRetrieve.addEventListener('click', Delegate.create(this.btnRetrieve));

      If i point my browser within my server php file, and i query the DB it works, but if i try to use it flash, nothing happends. Why?