0 Replies Latest reply on Sep 16, 2011 9:01 AM by Anthony Aymé

    Problem with URLVariables

    Anthony Aymé Level 1

      Hello,

       

      I want to make a generic function for send variables (post) to php

       

      I explain what i do showing you my function :

       

      [Bindable]

      public var my_variables:URLVariables = new URLVariables();

       

      public var enr_nombre_ligne_genere:int = new int(0);

       

      public function paramSend(numberOfParam:int):URLVariables

      {

      switch(numberOfParam)

      {

      case 1, 6, 19, 24:

           my_variables.enr_envoi_0 = 's:Group';

           my_variables.enr_envoi_1 = recuperationAncienMembre.ezforms_label.text;

           my_variables.enr_envoi_2 = recuperationAncienMembre.ezforms_ti.text;

           my_variables.enr_envoi_3 = recuperationAncienMembre.ezforms_ti.maxChars; // Num Carac

           my_variables.enr_envoi_4 = recuperationAncienMembre.ezforms_ti.width;// ezforms_telecommande_id.ez_curseur_taille_ti.value;

           my_variables.enr_envoi_5 = recuperationAncienMembre.ezforms_ti.id;

           my_variables.enr_envoi_6 = recuperationAncienMembre.x;

           my_variables.enr_envoi_7 = recuperationAncienMembre.y;

           my_variables.enr_envoi_8 = '/s:Group';

           enr_nombre_ligne_genere = 9;

           break;

      }

      return my_variables.enr_envoi_0;

      return my_variables.enr_envoi_1;

      return my_variables.enr_envoi_2;

      return my_variables.enr_envoi_3;

      return my_variables.enr_envoi_4;

      return my_variables.enr_envoi_5;

      return my_variables.enr_envoi_6;

      return my_variables.enr_envoi_7;

      return my_variables.enr_envoi_8;

      return String(enr_nombre_ligne_genere);

      }

       

      public function modificationLigneEcranCourantChampsTexte(event:MouseEvent):void

      {

      var enr_requete:URLRequest = new URLRequest('./interaction/ecran_courant.php');

      var enr_loader:URLLoader = new URLLoader(enr_requete);

       

      my_variables.elementSelectionne = nombreEnfant.text;

      my_variables.numrows = enr_nombre_ligne_genere.toString();

      parametreEnvoyeServeur(typeMatrice);

      enr_requete.method = URLRequestMethod.POST;

      enr_requete.data = enr_variables;

      try

      {

      enr_loader.load(enr_requete);

      }

      catch(erreur:Error)

      {

           trace("Unable to load requested document.", 3);

      }

      enr_loader.addEventListener(Event.COMPLETE, completeHandlerModifLigneEcranCourantTexte);

      }

      public function completeHandlerModifLigneEcranCourantTexte(event:Event):void

      {

           trace(event.target.data, 4);

      }

       

      Can someone explain me where is my error please ??

       

      Thanks

       

      Anthony