View Full Version : loadvariable problems

05-05-2001, 06:27 PM
I am trying to use a flash movie to view data pulled from a database. I am at the point where I have a static variable (html) page that I can pull a variable, var1, and can display them in the movie. What I am trying to do is to display var1 and then perform a check on var1. If var1 is x show a checkbox, if var1 is y show an empty box.

I get var1 to display in the movie, but I can not get the actionscript to recognize var1 in my "if" statement. Just for testing purposes, I have tried to set another variable, var2, equal to var1 and display it, but it displays only an empty box. I can not get var2 to equal var1 in the movie.

If I have var1 loaded and can display it in the movie, why can I not use it in congunction with variables and functions I set inside the movie?

Any help would be appreciated.

05-06-2001, 08:09 AM
YOu can, you've probably just made a mistake somewhere along the way...
Note first and foremost that loaded variables will most always come in as strings not numbers, so if you load a variable which should have the value 23 and test it to see if it equals 23, it will fail because it is the STRING "23".

Give us an example of your code and some more detail...



05-10-2001, 06:57 PM
Had another project to do past few days, just now getting back to my flash problem.

OK, here is what I am doing:

loadvariable ("home.html", variable2);
if (variable2 == "Cyclops")[

What this does is pull a variable, variable2, with a value of Cyclops from the page home.html.
I then display the value of variable2 on the page. The value, Cyclops, displays properly. What I am trying to do is to check the value of variable2. If the value is "Cyclops" the move displays frame 2 (the default is displaying frame 1). When running the movie, it always only shows frame 1.

Is there something I am missing to get the value to check variable2? Or, is I am missing something to get the movie to move on to the if statement after the variable is loaded?

I know I am missing something somewhere, but I haven't been able to find any posting similar to this problem.