3 Replies Latest reply on Jan 19, 2011 10:03 AM by Gaurav J

    Sending data with URLRequest

    SiHoop Level 1

      I'm having a problem sending multiple variables with a URLRequest when I attempt to send the variables from one file to another.

      The line below tries to send 2 variables: studentID=749 and studentName=sally

       

      var urlRequest:URLRequest = new URLRequest("http://..../ChartingComponents.html#studentID=749&studentName=sally");

       

      Inside the receiving file, I have the following code:

                      bm = BrowserManager.getInstance();   //Use  BrowserManager to get the incoming string of variables           
                      bm.init("");
                      //Parse a URL that passes string parameters after the "#" sign         
                      var o:Object = URLUtil.stringToObject(bm.fragment);  
                      userName=o.studentID;

                      studentName=o.studentName;

       

      I don't have a problem if I try to send only a single variable. If I send 2 variables, only the first variable is recognized and its value is: "749&studentName" instead of "749".

      So my question is, how do I send multiple variables when I use a URLRequest?

      Also, what's the difference between using # and ? in a URLRequest? I know that the ? adds a # sign to the end of my url string.

      Thank you!