Flasher Archive

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


Subject: Re: FLASH: random variable typing
From: John Croteau
Date: Fri, 8 Oct 1999 01:43:52 +0100

Hi MT,

> 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.
Actually I sort of took your word (or assumed) that your 3 examples were
incorrect. And you are right about one thing I was wrong about none of
the above (I only had time to supply a solution not study your 3
examples).
My D is identical to your A, except mine was copied right out of Flash
and has the colon after Variable which Flash adds automatically. You see
I knew mine worked because I took a minute to check it and make sure I
provided the correct syntax to you. Even though I use Flash and
ActionScript every day I do make mistakes if I don't paste it out, so if
its simple and I have Flash open the code you will see is straight from
Flash.

> 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.
Flash uses typeless variables that do not and can not have a data type
preset. They are evaluated by the type of operators thus differnt
operators for numeric and string operations.

> 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?
If you place a variable or expression in an expression field (with = and
not ABC) then Flash will evaluate that variable or expression and supply
the value stored in the resulting variable.

Thus:
Set Variable: "Hat" = "Brown"
Set Variable: Brown = "7"
RESULT Hat is Brown
and Brown is a null string because it was never set,
only its value Brown was.

Hope this helps.
-------------------------------------------
This was A
> > Here's what I'm talking about, by the way:
> > Set Variable "whichItem" = "redPants"
> > Trace(whichItem)
> > RETURNS "redPants"

This was D.
> Set Variable: "whichItem" = "redPants"
> Trace (whichItem)

--
Coming Soon Flash 4 Web Animation F/X and Design
http://www.amazon.com/exec/obidos/ASIN/1576105555/flashcentral
----------- -----------------------
John Croteau croteauaterols [dot] com (mailto:croteauaterols [dot] com)
------------- -------------------------
FlashTek (Advanced Websites with Flash) http://www.FlashTek.com/
Flash Bible (Fast track to good Flash) http://www.FlashBible.com/
Flash Central(The Universe Starts Here) http://www.FlashCentral.com/
The Flash Tech Resource (Tech Notes) http://www.FlashCentral.com/tech/
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

------------------------------------------------------------------------
To UNSUBSCRIBE send: unsubscribe flasher in the body of an
email to list-manageratchinwag [dot] com. Problems to: helpatchinwag [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-manageratchinwag [dot] com


Replies
  FLASH: random variable typing, M T

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