PDA

View Full Version : Regarding URLLoader and the & as a string



Soul814
June 13th, 2008, 10:21 PM
So you separate variables using the &, however if I want this as part of the string how would I do it?

Say I am sending


ice_cream=Tom & Jerry&size=large

If I were to encode all the special characters, what would the flash function to decode it be? Or should I just replace the & with a special key and then recode it when it gets passed into the flash file?

Thanks.

amarghosh
June 14th, 2008, 12:37 AM
use escape method;

var variables:URLVariables = new URLVariables();
variables.ice_cream = escape("Tom & Jerry");//space and & symbol will be converted to url encoded format;
variables.size = escape("large");

escape method is available in javascript also.

Soul814
June 14th, 2008, 07:59 AM
Sorry, I guess I was unclear.

In my flash document the dataFormat is of type variables.

The string being sent by the client was ice_cream=Tom & Jerry&size=large. Notice the & between Tom and Jerry. I was just wondering how to send that string into flash without Jerry being separated as a variable.

I ended up just using dataFormat text instead.