2 Replies Latest reply on Dec 16, 2006 9:22 AM by swickes

    Single Quotes and Double Quotes

      This is actually as much of a scripting question as a Flex question, but it's causing me problems as I use FlashVars.

      What's the rule or best practice when it comes to using double and single quotes? These two lines (from the Flex default html wrapper named, "index.template.html") seem to use combinations of quotes (single and double) in two different ways. I also am curious about the seemingly extraneous quotes at the end of both lines- "" in one case and '' in the other.

      1. In the first AC_FL_RunContent( you find this
      "FlashVars", "MMredirectURL="+MMredirectURL+'&MMplayerType='+MMPlayerType+'&MMdoctitle='+MMdoctitle+"" ,

      2. In the second AC_FL_RunContent( you find this
      "flashvars",'historyUrl=history.htm%3F&lconid=' + lc_id + '',

      Thanks in advance to whomever can solve this!
        • 1. Re: Single Quotes and Double Quotes
          ntsiii Level 3
          First, this is not a Flex Builder question, so it should go in the Flex General Discussion forum, not here.

          In both javascript and actionscript, you can use either character, the pairs just have to match. So depending on which one you want to embed, you use the other on the outside. I don't know of any "Best Practice" regarding any other choice of usage.

          I haven't analyzed that script in the wrapper, but I am pretty sure both cases are appending an empty string, one using double quotes, and one using single. Why, I don't know. Take em out and see what breaks.

          • 2. Re: Single Quotes and Double Quotes
            swickes Level 1

            Thanks for your reply. Thanks for overlooking that I posted in the wrong forum!