![MACROMEDIA FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE Reference Download Page 1140](http://html.mh-extra.com/html/macromedia/flash-8-actionscript-2-0-language/flash-8-actionscript-2-0-language_reference_6875371140.webp)
1140
ActionScript classes
toString (String.toString method)
public toString() : String
Returns an object's properties as strings regardless of whether the properties are strings.
Availability:
ActionScript 1.0; Flash Player 5
Returns
String
- The string.
Example
The following example outputs an uppercase string that lists all of an object's properties,
regardless of whether the properties are strings:
var employee:Object = new Object();
employee.name = "bob";
employee.salary = 60000;
employee.id = 284759021;
var employeeData:String = new String();
for (prop in employee)
{
employ= employee[prop].toString().toUpperCase() + " ";
}
trace(employeeData);
If the
toString()
method were not included in this code, and the line in the
for
loop used
employee[prop].toUpperCase()
, the output would be "
undefined undefined BOB
".
Including the
toString()
method produces the desired output: "
284759021 60000 BOB
".
toUpperCase (String.toUpperCase method)
public toUpperCase() : String
Returns a copy of the String object, with all lowercase characters converted to uppercase. The
original value is unchanged.
Availability:
ActionScript 1.0; Flash Player 5
Returns
String
- A string.
Summary of Contents for FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE
Page 1: ...ActionScript 2 0 Language Reference ...
Page 1352: ...1352 ActionScript classes ...