Not signed in (Sign In)

Vanilla 1.0.3 is a product of Lussumo. More Information: Documentation, Community Support.

    • CommentAuthorJulien
    • CommentTimeMar 27th 2007
     
    Hi,

    A few days ago, I encountered a problem with the "addVariable" method: the value I wanted to add was a URL and contained the "&" character.
    so.addVariable("myVar", "action?a=1&b=2");

    The generated "FlashVars" looked like "myVar=action?a=1&b=2", which was (correctly) interpreted by the Flash player as two FlashVars : "myVar=action?a=1" and "b=2".

    I used the "encodeURIComponent" function to fix this problem:
    so.addVariable("myVar", encodeURIComponent("action?a=1&b=2"));

    I've seen that I am not the only one to have encountered this problem.

    My question is: why does SWFObject not call the "encodeURIComponent" itself on the variables ?

    Thank you by advance. :-)
    • CommentAuthorGeoff
    • CommentTimeMar 27th 2007
     
    SWFObject does not do any encoding for variables.

    When I originally wrote it, I was using encode(), but it turns out that encode() will screw up double-byte characters like chinese or japanese, etc.

    So I looked into using encodeURIComponent, but found out that it's not supported in some older browsers (ie5.5 i think doesn't have it, or maybe it was ie5).

    So at the time I left it out - although I may add it back in sometime soon, as the ie5.0 user base drops.
    • CommentAuthorJulien
    • CommentTimeMar 28th 2007
     
    Thank you for your answer. :-)