[osflash] Automagic URL encoding of variables in FlashObject?

Geoff Stearns geoff at deconcept.com
Wed Aug 17 21:56:46 PDT 2005


It's a good suggestion, and it's come up before, but javascript just 
doesn't have a reliable urlencode function.

encode() chokes on double byte chars (the first version of flashobject 
used encode() by default, but was later removed due to the double byte 
problem)

so i would have liked to replace it with encodeURIcomponent(), but that 
doesn't have good enough support throughout the browsers i wanted to 
support. at some point in the future i'm sure i'll reevaluate this, but 
for now i'd rather leave it out.

writing a custom URLencode() function i don't really like because it 
adds bloat to the script that many people will not use much.

which is why it's set at the current state, where you have the option of 
using encode(), which will work in most cases, or encodeURLcomponent() 
if you dont' mine cutting out older browsers, or doing server side 
encoding as you mention.

so that's the history behind that - bob ippolito actually put the 
encode() back in for his flashobject implementation that is in the JSAN 
library, but just marked it with a comment about the double byte char 
problem.



Olivier wrote:

>What do you think about the idea of URL encoding the variables that one 
>can add in the HTML?
>
>We would have this in the HTML:
>fo.addVariable("mainURL", "http://www.domain.com/myFlash/");
>and it would automatically be converted to:
>mainURL=http%3A%2F%2Fwww.domain.com%2FmyFlash%2F
>
>The addVariable method would need to be modified with something like
>value = this.URLencode(value);
>and we would have to include the URLencode method in FlashObject. A 
>simple escape() doesn't work.
>
>Most of us have an URL encoder somewhere and most of the FlashVars are 
>provided by server-side scripts, but at times a customer needs to modify 
>the value of one of the variable and even for us, it's so much faster to 
>just type in the value without having to preprocess it.
>
>No?
>
>Olivier
>
>
>_______________________________________________
>osflash mailing list
>osflash at osflash.org
>http://osflash.org/mailman/listinfo/osflash_osflash.org
>  
>



More information about the osflash mailing list