MACROMEDIA FLEX-FLEX ACTIONSCRIPT LANGUAGE Reference page 151

Actionscript language reference
Table of Contents

Advertisement

escape()
Availability
Flash Player 5.
Usage
escape(expression:String) : String
Parameters
The expression to convert into a string and encode in a URL-encoded format.
expression
Returns
URL-encoded string.
Description
Function; converts the parameter to a string and encodes it in a URL-encoded format, where all
nonalphanumeric characters are replaced with % hexadecimal sequences. When used in a URL-
encoded string, the percentage symbol (%) is used to introduce escape characters, and is not
equivalent to the modulo operator (%).
Example
The following code produces the result
var email:String = "someuser@somedomain.com";
trace(escape(email));
In this example, the at symbol (
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,
var redirectUrl = "http://www.somedomain.com?loggedin=true&username=Gus";
getURL("http://www.myothersite.com?returnurl="+ escape(redirectUrl));
See also
unescape()
ActionScript Core Language Elements
someuser%40somedomain%2Ecom
) was replaced with
@
%40
or
), as shown in the following code:
&
?
:
and the dot symbol (
.
CHAPTER 5
) was replaced
escape()
151

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLEX-FLEX ACTIONSCRIPT LANGUAGE and is the answer not in the manual?

Subscribe to Our Youtube Channel

This manual is also suitable for:

Flex

Table of Contents