Flasher Archive
[Previous] [Next] - [Index] [Thread Index] - [Previous in Thread] [Next in Thread]
Subject: | FLASH: random variable typing |
From: | M T |
Date: | Thu, 7 Oct 1999 17:01:40 +0100 |
John,
The answer is actually A, not D, none of the above. I certainly appreciate
your help, but you should probably not try to come across as the master expert
all the time.
I have it working already. My question is about variable typing. Roughly
speaking, strongly typed languages require you to declare a variable
specifically as a string or expression, whereas loosely typed languages figure
it out on their own. The way flash is set up is, to me, a bit illogical. In
the example I included, whichItem is ALWAYS a variable. However, in order to
get the value "redpants" into it, you have to present it in quotes
("whichItem"). If it's a variable, it seems to me that it should ALWAYS be an
expression. However, if the quotes are working as some sort of typing (telling
Flash that the variable you're putting in is a string), then it makes no sense
that when you use trace, you use whichItem in no quotes. To be consistent,
whichItem should either not be in quotes the 1st time, or it should be in
quotes the 1st time and the trace statement should be trace(eval("whichItem")).
At least that's how I see it. Macromedia? Anyone else see how the way it's set
up is, in fact, logical?
MT
Hi MT,
> Here's what I'm talking about, by the way:
> Set Variable "whichItem" = "redPants"
> Trace(whichItem)
> RETURNS "redPants"
> Set Variable whichItem = "redPants"
> Trace(whichItem)
> RETURNS nothing
> Set Variable "whichItem" = "redPants"
> Trace("whichItem")
> RETURNS whichItem
> and throughout all of these, an empty field named whichItem, on the stage,
> never contains "redPants". So what's up? If whichItem is a variable, it is
an
> expression, and to my way of thinking, should be treated as such (never in
> quotes). However, to put a string in it, it seems like it needs to be quoted
> as a literal. Then, on the other hand, when you trace it, you DON'T put
quotes
> around it. So what's the deal?
The answer is D none of the above;
Set Variable: "whichItem" = "redPants"
Trace (whichItem)
RETURNS redPants which is the value of whichItem
And a Text Field with whichItem as its variable will also display
redPants.
When setting a variable the ABC switch should be on for the top (left
side of the expression) unless it is an expression.
In Trace here you are looking for the value of whichIten so it should be
an expression.
__________________________________________________
Do You Yahoo!?
Bid and sell for free at http://auctions.yahoo.com
------------------------------------------------------------------------
To UNSUBSCRIBE send: unsubscribe flasher in the body of an
email to list-managerchinwag [dot] com. Problems to: helpchinwag [dot] com
N.B. Email address must be the same as the one you used to subscribe.
For info on digest mode send: info flasher to list-managerchinwag [dot] com
Replies
Re: FLASH: random variable typing, John Croteau
[Previous] [Next] - [Index] [Thread Index] - [Next in Thread] [Previous in Thread]