Not signed in (Sign In)

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

    • CommentAuthorkamermans
    • CommentTimeDec 20th 2006 edited
     
    I'm converting a large number of sites from the standard embed tags that Flash/Dreamweaver creates to the SWFObject-friendly alternative, so I have made a handly little script to do the leg-work for me. It's called "HTML2SWFObject" and is located at http://devel.teratechnologies.net/swfhelp/ (I made it publicly available since I think it's a HUGE time saver :D ). I have recently added support for FlashVars but I'm not sure how I should handle the data, consider this tag:

    <param name="FlashVars" value="id=437&uid=1&soundtitle=AG+Silver+-+Dangerously+%281%29&custom=" />

    All the variables are url encoded ('escaped' in JS) - should I urldecode/unescape them when I use them in the addVariable() method?

    urlencoded:
    so.addVariable("id", "437");
    so.addVariable("uid", "1");
    so.addVariable("soundtitle", "AG+Silver+-+Dangerously+%281%29");
    so.addVariable("custom", "");

    urldecoded:
    so.addVariable("id", "437");
    so.addVariable("uid", "1");
    so.addVariable("soundtitle", "AG Silver - Dangerously (1)");
    so.addVariable("custom", "");

    I know certain characters would need to be escaped (like \" \'), but I can use the PHP funtion addslashes() to do that for me. I just don't want SWFObject to escape() my urlencoded characters.

    I guess I could probably just do some tests and such, but I thought it was worth bringing up.

    Thanks!

    Steve Kamerman
    http://devel.teratechnologies.net/swfhelp/
    • CommentAuthorGeoff
    • CommentTimeDec 21st 2006
     
    swfobject does not url encode when you use addVariable()

    this is because not all browsers support encodeURIComponent()

    i originally set it up to use escape() since that works in everything, but escape has issues with double byte characters, like those used in asian languages.. so for now you have to pick which one is right for you and manually encode/escape your flashvars.
    • CommentAuthorkamermans
    • CommentTimeDec 21st 2006
     
    Ok - good! This is how it's done with the normal embed tag's FlashVars param anyway. Thanks!