Table of Contents

unescape( ) Global Function Flash 5

decode an escaped (URL-encoded) string
unescape(stringExpression)

Arguments

stringExpression

A string (or an expression that resolves to a string) that was previously encoded via escape( ).

Returns

A new string that is a decoded version of string.

Description

The unescape( ) function returns a new string based on string. The new string contains equivalent characters for every occurrence of hexadecimal escape sequences in string, as described under escape( ). The escape( ) and unescape( ) functions are used to encode and decode strings for safe transfer over a network. However, manual use of unescape( ) rarely is necessary, as Flash automatically unescapes URL-encoded text when it is imported via loadVariables( ) or the LoadVars class.

Example

var msg = "hello!";
// Set msgCoded to "hello%21"
msgCoded = escape(msg);
// Set msgDecoded to "hello!"
var msgDecoded = unescape(msgCoded);

See Also

escape( ); Appendix B


Table of Contents