Eval Function - MACROMEDIA FLASH 8-FLASH LITE 2.X ACTIONSCRIPT LANGUAGE Reference

Flash lite 2.x actionscript language reference
Hide thumbs Also See for FLASH 8-FLASH LITE 2.X ACTIONSCRIPT LANGUAGE:
Table of Contents

Advertisement

Parameters
- The expression to convert into a string and encode in a URL-encoded
expression:String
format.
Returns
- URL-encoded string.
String
Example
The following code produces the result
:
someuser%40somedomain%2Ecom
var email:String = "someuser@somedomain.com";
trace(escape(email));
In this example, the at symbol (
) was replaced with
and the dot symbol (
) was replaced
@
%40
.
with
. This is useful if you're trying to pass information to a remote server and the data has
%2E
special characters in it (for example,
or
), as shown in the following code:
&
?
var redirectUrl = "http://www.somedomain.com?loggedin=true&username=Gus";
getURL("http://www.myothersite.com?returnurl="+ escape(redirectUrl));
See also
unescape function

eval function

eval(expression:Object) : Objecteval(expression:String) : Object
Accesses variables, properties, objects, or movie clips by name. If expression is a variable or a
property, the value of the variable or property is returned. If expression is an object or movie
clip, a reference to the object or movie clip is returned. If the element named in expression
cannot be found, undefined is returned.
In Flash 4,
was used to simulate arrays; in Flash 5 or later, you should use the Array
eval()
class to simulate arrays.
In Flash 4, you can also use
to dynamically set and retrieve the value of a variable or
eval()
instance name. However, you can also do this with the array access operator (
).
[]
44
ActionScript language elements

Advertisement

Table of Contents
loading

Table of Contents