Example
Running the following code gives the result,
escape("Hello{[World]}
See also
unescape
eval()
Availability
Flash Player 5 or later for full functionality. You can use the
Flash Player 4, but you must use slash notation, and can only access variables, not properties
or objects.
Usage
eval(expression)
Parameters
A string containing the name of a variable, property, object, or movie clip
expression
to retrieve.
Returns
A value, reference to an object or movie clip, or
Description
Function; accesses variables, properties, objects, or movie clips by name. If
variable or a property, the value of the variable or property is returned. If
or movie clip, a reference to the object or movie clip is returned. If the element named in
cannot be found,
expression
In Flash 4,
eval()
the Array class to simulate arrays.
In Flash 4, you can also use
instance name. However, you can also do this with the array access operator (
In Flash 5 or later, you cannot use
instance name, because you cannot use
replace the code
eval ("var" + i) = "first";
with this:
this["var"+i] = "first"
or this:
set ("var" + i, "first");
380
Chapter 12: ActionScript Dictionary
"
);
undefined
was used to simulate arrays; in Flash 5 or later, it is recommended that you use
to dynamically set and retrieve the value of a variable or
eval()
eval()
eval()
Hello%7B%5BWorld%5D%7D
eval()
.
undefined
is returned.
to dynamically set and retrieve the value of a variable or
on the left side of an equation. For example,
.
function when exporting to
is a
expression
is an object
expression
).
[]
Need help?
Do you have a question about the FLASH MX 2004 - ACTIONSCRIPT and is the answer not in the manual?