Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7734629
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T07:17:49+00:00 2026-06-01T07:17:49+00:00

This only happens in IE. I’m using swfobject and loading the flash vars as

  • 0

This only happens in IE.

I’m using swfobject and loading the flash vars as such

var flashVars = {
       myVar:'{"url":"http://google.com/", "id":"9999"}',
};
var params = {
    allowFullScreen:"true",
    wmode:"transparent",
    allowScriptAccess:'always'
    };
swfobject.embedSWF("mySwf.swf", "mySwf", "512", "318", "10.0.0", "./js/swfobject/expressInstall.swf", flashVars, params);

Everything works perfectly in all browser but IE. I checked myVar and it comes into the swf as { and that’s it. I know it’s dying at the '. I’ve tried putting a \ infront, then tried \\ and kept adding one slash until I got to \\\\\\\\. I even inverted all the slashes and tried the same ritual. Nothing.

I can get the string to finally come through, with inverted quotes and using double slashes, but then my JSON parser gets mad about there being slashes in my string.

Here’s an example of what works, but of what is invalid JSON:

"{\\'url\\':\\'http://google.com/\\', \\'id\\':\\'9999\\'}"
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T07:17:51+00:00Added an answer on June 1, 2026 at 7:17 am

    Yep IE treats flashVars differently to all the other major browsers, I believe you need to make use of the JavaScript encodeURIComponent method which will escape all reserved characters from your String, eg:

    // Removing all reserved characters from the flashVar value.
    var flashVars = {
       myVar: encodeURIComponent('{"url":"http://google.com/", "id":"9999"}'),
    };
    

    If you are passing multiple values in the flashVars then you could iterate through them and encode all chars in a single pass:

    var flashVars = {
       myVar: '{"url":"http://google.com/", "id":"9999"}',
       anotherVar: 42
    };
    
    // Escape all values contained in the flashVars object.
    for (key in flashVars) {
        if (flashVars.hasOwnProperty(key)) {
            flashVars[key] = encodeURIComponent(flashVars[key]);
        }
    }
    

    As @dgmdan and @bcmoney suggested, it would probably make your code easier to read if you made use of JSON.stringify – however, you need to bear in mind that IE8 and below do not have a native JSON object, so you will need to include Crockford’s JS Library in your HTML page.

    // Making use of a JSON library.
    var flashVars = {
       myVar: encodeURIComponent(JSON.stringify({ url: "http://google.com/", id: "9999"})),
    };
    

    Also, it’s worth bearing in mind that flashVars are limited to ~64k; so if you are planning to pass a lot of data, it might be better to use an ExternalInterface call to pull them from the JavaScript instead.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This only happens in some IE's. Here: http://animactions.ca/Animactions/volet_entreprise.php You may notice that when you
My url generates like this: only shows in ie9 http://myurl.com/#/categories/posts how do I remove
This only happens when using the compatibility library for pre-3.0 devices I'm getting an
I am not sure whether this only happens to me. Basically if I have
I am authenticating users in ldap, but this happens only once, when user is
Im getting this linker error that won't let me compile. It only happens on
This is an odd behaviour by my D2006 as it happens sometimes only. I
why does this only alert 1 ? function test() { var myobj = {
This only happens from time to time, seems random and I have not been
This only happens on my local machine (Windows 7, Ruby 1.8.7). Occasionally rails will

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.