Flasher Archive
[Previous] [Next] - [Index] [Thread Index] - [Previous in Thread] [Next in Thread]
Subject: | Variables |
From: | Phil Matt |
Date: | Thu, 25 Jan 2001 15:16:47 -0000 |
Gregg Caines wrote:
> You've got the syntax right for making the variable global (usable by
> all clips on the stage) by putting the /: in front of it.
>
> Your problem is that you set it to "1" (which is a string, with one
> character, which is a 1). Use trace("textstatus is" & /:textstatus)
> to verify that the value is in there.
>
> Next, in your if statement, put If (/:textstatus eq "1") ...
> You must test strings using 'eq'. Otherwise you can can set the
> variable to be 1, not "1", and use =
Gregg - thanks for your note. I eventually scoped out the problem
with the string vs. numerical expressions. I found it kinda strange
that typing in the = sign wouldn't automatically tell Flash that I was
intending an arithmetic operation. I figured out the problem by
trying a string and using the eq expression.
However, even though I can get the variables to work properly if I
assign strings to them, I STILL cannot get variables to work if I try to
use numeric values. I have checked and double-checked my
expressions, but it seems that Flash somehow doesn't recognize a
statement such as
Set variable /:whatever = 1
If I do a List Variables under Test Movie, and Output window shows:
Layer #0:
Variable _level0:whatever = "1"
I cannot get the 1 without the quotes around it regardless of how I
write the expression.
> I'd also recommend using Visible instead of Alpha, where visible is
> either true or false.
This was just for testing. Actually, depending on the state of the
variable is use, the roll over will just play a different frame of a MC
containing one text box per frame. This is being used for giving the
user contextually-sensitive info.
> Hopefully Flash 5 hasn't mangled my memory too much...
I have Flash 5, but am not planning to switch over until more users
have it installed.
Thanks again for your help.
Cheers --- Phil
Phil Matt Photography
www.philmatt.com
716-461-5977
[Previous] [Next] - [Index] [Thread Index] - [Next in Thread] [Previous in Thread]