Flasher Archive

[Previous] [Next] - [Index] [Thread Index] - [Previous in Thread] [Next in Thread]


Subject: Variables
From: Phil Matt
Date: Thu, 25 Jan 2001 15:23:16 -0000

Paul Willoughby wrote:

> You should be using:
>
> If (/:textStaus = 1)
>
> or
>
> If (/:textStaus eq "1")
>
> If you have "/:textStatus" like this in quotes, then you're comparing
> actual string "/:textStatus" value to 1, rather than it's value as a
> variable, which is why nothing happens.

Hi, Paul. I eventually figured this out late yesterday.
>
> You should also set your variable as an expression, not a string:
>
> Set Variable: "/:textstatus" = 1 //no quotes

Oddly enough, Flash doesn't seem to like this, either. I tried using
string values and the eq expression, and my variables worked
perfectly. I then changed them to using numerical values, making
sure that there were no quotes around my numbers, but Flash was
still interpreting them as string - I think.

I found that the expression in my variable statement

Set variable /:whatever = 1

Shows (via List Variables under Test Movie) in the Output window

Layer #0:
Variable _level0:whatever = "1"

I cannot get the 1 without the quotes around it regardless of how I
write the expression.

> Flash 4 will normally automatically convert numeric values from
> strings to numbers and vice versa if need be, but I wouldn't rely on
> it. The best idea is to just keep your code consistent i.e. compare
> numbers to numbers with '=', and strings to strings with 'eq'.
>
Right. I'm going to have another go at using the numerical values
later. At least I know that I've got the syntax right.

Thanks again or your help.

Cheers --- Phil
Phil Matt Photography
www.philmatt.com
716-461-5977



[Previous] [Next] - [Index] [Thread Index] - [Next in Thread] [Previous in Thread]