1 Reply Latest reply on Aug 11, 2010 11:47 PM by fleRavix

    How can i pass Pass the values between two different modules ?

    flex4 Level 2

      Hi All,

       

               I have two modules and i am loading that modules at runtime ... I have requirement to send the data from first module to second module ... How can i achieve this ??

        • 1. Re: How can i pass Pass the values between two different modules ?
          fleRavix
          Use this :
          
          var s:String = "movies/QueryStringModule.swf?" + "firstName=" + value1 +
                                             "&lastname=" + value2; 
          
                          m1.url = s;
          In teh destination module use this,
          
          
          var myPattern:RegExp = /.*\?/;
          
          var s:String = this.loaderInfo.url.toString();
          
                              s = s.replace(myPattern, "");
          
                              /* Create an Array of name=value Strings. */
                              var params:Array = s.split("&");
                              
                              /* Print the params that are in the Array. */
                              var keyStr:String;
                              var valueStr:String;
                              var paramObj:Object = params;
                              for (keyStr in paramObj) {
                                  valueStr = String(paramObj[keyStr]);
                                  ta1.text += keyStr + ":" + valueStr + "\n";
                              }
          
                              /* Set the values of the salutation. */
                              for (var i:int = 0; i < params.length; i++) {
                                  var tempA:Array = params[i].split("=");                        
                                  if (tempA[0] == "firstName") {
                                      o.firstName = tempA[1];
                                  } 
                                  if (tempA[0] == "lastName") {
                                      o.lastName = tempA[1];
                                  } 
          Mark this if helpful
          1 person found this helpful