troubleshooting Question

AS3 problem with sending variables

Avatar of derrida
derrida asked on
Adobe Flash
5 Comments1 Solution2319 ViewsLast Modified:
hi

i have a form that i want to send its variables to a php file.

so i have this code in flash:

//-------------------------------INSERTING------------------------------------\\

insertit.addEventListener(MouseEvent.CLICK, sendTheData);

function sendTheData (ev:MouseEvent) {
      var myReq:URLRequest= new URLRequest("insertit.php");
      myReq.method= URLRequestMethod.POST;
      
      var myVars:URLVariables= new URLVariables();
      myVars.firstNAME = fNAME.text;
      myVars.email = EMAIL.text;
      myVars.phone = PHONE.text;
      myVars.lastNAME = lNAME.text;
      
      myReq.data=myVars;
      trace(myReq.data);
      
      var myLoader:URLLoader= new URLLoader();
      myLoader.dataFormat= URLLoaderDataFormat.VARIABLES;
      myLoader.addEventListener(Event.COMPLETE, tellMe);
      myLoader.load(myReq);
      
}

function tellMe (ev:Event) {

      
}

and for now the php file only take the variables and does not do anything with it.

when i try to send the data i get this message in the output:

firstNAME=shimon&phone=45876578346&lastNAME=peres&email=peres%40walla%2Ecom

Error: Error #2101: The String passed to URLVariables.decode() must be a URL-encoded query string containing name/value pairs.

the first line is my trace and it shows thet it does come as name\value pair. so i have no idea what to do with the error message.


help will be very appriciated.


best regards

ron
ASKER CERTIFIED SOLUTION
derrida

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 5 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 5 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros