• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 318
  • Last Modified:

Problem with special caracters using loadVariables function ( Flash actionscript)

Hello,
I encounter some problems with the loadVariables function.

l_url = "index.php?var1=ddd:ee/ff&var2=ggg";
this.createEmptyMovieClip("mc1", _root.getNextHighestDepth());
loadVariables(l_url, mc1);

The values of var1 and var2 are inserted by the users. In the case written above, nothing happens because of special caracters that crash/block the process. In many cases, there are no problem...

Two questions:
- which are the caracters that do not pass through the loadVariables ?
- does have anyone a clean way to solve that problem?

Thanks for your attention,

V
0
vanpevi
Asked:
vanpevi
  • 3
  • 2
  • 2
  • +1
1 Solution
 
najhCommented:
what text examples are you having trouble with? quotes? single quotes?
0
 
vanpeviAuthor Commented:
hello najh,
in the exemple above, the : causes the crash...
0
 
najhCommented:
so are the values being loaded into the variables ok? Is it the ongoing processing of the variables where the problem lies or is it an issue as soon as the ":" arrives in the variable?
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
vanpeviAuthor Commented:
Flash Var1 and Var2 are always well filled in... the l_url is always well created...the function loadVariables is always well called...But this function crashes/blocks sometimes because of its arguments...
0
 
CyanBlueCommented:
What if you try this???

this.createEmptyMovieClip("mc1", _root.getNextHighestDepth());

str1 = "ddd:ee/ff";
str2 = "ggg";
str1 = escape(str1);
str2 = escape(str2);
l_url = "index.php";

_lv = new LoadVars();
_lv.var1 = str1;
_lv.var2 = str2;
_lv.onLoad = function (ok)
{
      if (ok)
      {
            // Finished loading data...
            // Do whatever you want here...
      }
      else
      {
            // Problem loading data...
      }
}
_lv.sendAndLoad(l_url, _lv, "GET");

CyanBlue
0
 
sg3003Commented:
try adding he following code to the first line of the first frame, no promises but it's fixed a simular problem i had:

System.useCodepage = true;
0
 
vanpeviAuthor Commented:
Cyanblue, I didn't know the function escape, thanks a lot... it works fine !
0
 
CyanBlueCommented:
Glad to help...  :)

CyanBlue
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

  • 3
  • 2
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now