PDA

View Full Version : Variables ... again, I am sure


web-dept
12-08-2002, 06:24 PM
I am passing a variable to a flash movie from a simple javascript on an html page. I would like to use the value of the variable as a trigger. You know , If (myvar == "trigger") ... do something. The problem I am having is I can't seem to use the variable.

I know the variable is available in the movie because if I place a dynamic text field in the movie the value of my variable appears. If I try to use the variable as a trigger like:

myvar = _root.variable;
if (myvar == "trigger") {
_root.play(4);
} else {
stop();
}

The variable "myvar" has no value. What am I doing wrong?
:confused:
Thanks in advance

Ricod
12-08-2002, 07:32 PM
Are you sure _root.variable has a value ? What do you get when you trace 'myvar' ? Undefined ? That would be weird if _root.variable does have a value ...

annexion
12-08-2002, 09:42 PM
myvar = [_root.variable];

Try that.

Good luck.