3 Replies Latest reply on Jun 6, 2007 5:22 PM by SmileKZS

    problems with FLASHVAR and "&"

    orgadol

      i want to send a FLASHVAR to the flash from the HTML.
      in the FLASHVAR value i have more then one "&" and for some reason the flash takes everything after the '&' as another FLASHVAR!!!
      i tried doing the 26% with JC but that didn’t work either (all the "&" got mixed up)
      Please help!!

      p.s. the solution must be inside the flash
        • 1. Re: problems with FLASHVAR and "&"
          SmileKZS
          ABSOLUTELY the solution is OUTTA flash.
          Guess your refer to "JavaScript" by "JC"?
          When you are writing the FlashVar part of the html code, escape everything.
          it may look like the attach code....

          I am not a pro in JS but since the FlashVar is URL-Encoded... those lovely %xx .... got a clue?
          • 2. problems with FLASHVAR and "&"
            orgadol Level 1
            not good, this is in JS... i need it to be in the flash...
            • 3. Re: problems with FLASHVAR and "&"
              SmileKZS Level 1
              THERE IS NO SOLUTION IN FLASH!!!

              As you can see the whole FlashVar thing is the same as LoadVar thing! What will happen if you try to load a file look like:

              my&&&var1=my&&value&my&&var2=my&&value2

              ???

              The FlashVars are passed onto the flash plugin by "url-encoded form strings" as you can see after any dynamic pages like xxx.aspx?abc=xyz&efg=mno& stuff after the question mark. If you don't encode the "&" happened to appear in the string, the thing won't just work! because the "&" itself has the meaning of "next argument" so in your string any "&" would start a new argument. The only way to avoid this, is to replace every "&" which you would like to treat as a character in your argument/value into "%26".

              Here is something said on my book:Macromedia Flash 8 ActionScript Training from the Source:

              "Place a "&" between name/value pairs to add more variables"

              And yeah. There is a flash solution down there, but it is not automatic like what you wanted. You can use the code below to generate the FlashVars string on by one.

              var str:string="the FlashVar containing some &";
              trace(escape(str));

              in the output window you can see the result. But this is not automated. You can add the processed string into a static html. Since you don't know javascript well.