Table of Contents

LoadVars.decode( ) Method Flash 6 (undocumented)

Convert a URL-encoded string of variables to properties
loadVarsObject.decode(varString)

Arguments

varString

A string of URL-encoded variables. For information on URL encoding, see the Description heading under the LoadVars class entry.

Description

The decode( ) method converts the URL-encoded variables in varString to properties of the specified loadVarsObject. It offers a handy means of converting URL-encoded variables to object properties, as required by LoadVars.onData( ). Although undocumented, you can expect it to remain supported, because it is used internally by Flash to receive loaded variables.

Note that the property values created by decode( ) are always strings.

Example

// Create a LoadVars instance
varsObj = new LoadVars();
   
// Convert a string to the object properties x and y
varsObj.decode("x=10&y=20");
   
// Check the value of y
trace(varsObj.y);  // Displays: 20

See Also

LoadVars.load( ), LoadVars.onData( )


Table of Contents