Hi, I'm sending some data from Flash to an ASP page using the loadVars() Post method and sometimes the data is not passed to the ASP page correctly. (This happens alot in Netscape 6 with Flash player 6.21) The ASP page doesn't receive any values and content-type from Flash when this problem occurs. Has anyone ran into problems with passing data to ASP using the loadVars() According to Macromedia one way to work around this problem is to manually set the content-type on the serverside. I have no idea how to do this. Can someone help me? Here is my actionScript code: formData = new LoadVars(); formData.shoppingCart.toString(); //converts an array into a string formData.euroSubTotal= numberToDisplayString(tempEuro); formData.sfrSubTotal= numberToDisplayString(tempSfr); formData.language=lang; formData.send("checkout.asp","_blank", "post"); on the server side I use the Request.form method to retrieve the variables inside formData. Thanks for your help
You really should look at an XML solution rather than LoadVars(). It keeps your data in a structured format and is easier to send and load between ASP and Flash. Worked first time I tried it and saves a lot of headaches when you are trying to send a lot of information - love XML!
In your ASP page to send XML set the response type to: [b]Response.ContentType = "text/xml"[/b]
I'm curious about this line. formData.shoppingCart.toString(); //converts an array into a string Is shoppingCart a variable that you passing? By the way I ran into a suggestion by a senior member that suggested that a lot of people have trouble with variable caching in flash data transfers. He suggested that people will attach random letters to the end of a url in perhaps a query string to force pages to refresh. I haven't tried it but I'm just throwing it out because I've been battling with a load problem for several days now and what you're up against is not any easy thing to solve.
Don't see what you're looking for? Try a search.
|