Flasher Archive
[Previous] [Next] - [Index] [Thread Index] - [Previous in Thread] [Next in Thread]
Subject: | Re: FLASH: When to Use (Eval)? |
From: | fritz |
Date: | Tue, 13 Jun 2000 02:43:08 +0100 |
in actionscript, eval is only ever used when you want to refer to the
name of a variable with a string (or an expression that yields a
string). the string may be a literal string or any expression that
results in a string.
for example:
x = eval("firstName")
...if the variable firstName exists, then its value is retrieved and
assigned to x.
usually, eval involves some kind of string operation. so:
x = eval("first" & "Name")
is synonymous with the first example.
in flash 4 eval is frequently used to dynamically refer to sequentially
named variables. so suppose we have three variables: name1, name2, and
name3. we could use an eval function to retrieve any of their values
like this:
num = 2
someName = eval("name" & num)
you can use that technique to simulate arrays.
(note that this differs from javascript, where the eval function causes
its argument to be executed, and its argument can be any code as long as
it's contained in a string.)
// sig
0100110101001111010011110100001101001011.org
<moock>colin</moock>
----- Original Message -----
From: "Marc Hoffman, Poison Dart Frog Media" <maildartfrogmedia [dot] com>
To: <flasherchinwag [dot] com>
Sent: Monday, June 12, 2000 10:34 AM
Subject: FLASH: When to Use (Eval)?
> I'm looking for a clear explanation of when to use (Eval) and when not
to
> use it. Can someone come up with a clear rule I can pass along to my
students?
>
> Thanks.
>
> Marc Hoffman
>
> Poison Dart Frog Media
> Flash portfolio: http://www.dartfrogmedia.com/portfolio
>
>
> flasher is generously supported by...
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> flashforward2000 and the Flash(tm) Film Festival
> July 24-26, 2000, NEW YORK CITY, Hammerstein Ballroom
> www.flashforward2000.com
> Produced by United Digital Artists and lynda.com
> Sponsored by Macromedia, Adobe Systems, Fusion, Inc, AtomFilms,
> shockwave.com and Electric Rain.
> 1.877.4.FLASH.4 or (1.805.640.6679 outside the US and Canada)
> Register before June 30 and save $200!!-- www.flashforward2000.com
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> To unsubscribe or change your list settings go to
> http://www.chinwag.com/flasher or email helpchinwag [dot] com
>
>
flasher is generously supported by...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
flashforward2000 and the Flash(tm) Film Festival
July 24-26, 2000, NEW YORK CITY, Hammerstein Ballroom
www.flashforward2000.com
Produced by United Digital Artists and lynda.com
Sponsored by Macromedia, Adobe Systems, Fusion, Inc, AtomFilms,
shockwave.com and Electric Rain.
1.877.4.FLASH.4 or (1.805.640.6679 outside the US and Canada)
Register before June 30 and save $200!!-- www.flashforward2000.com
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To unsubscribe or change your list settings go to
http://www.chinwag.com/flasher or email helpchinwag [dot] com
Replies
FLASH: When to Use (Eval)?, Marc Hoffman, Poison Dart
[Previous] [Next] - [Index] [Thread Index] - [Next in Thread] [Previous in Thread]