SWiSH Player Support
SWF5 or later - Supported Internally
Syntax
new Object({ value });
Arguments
value; Optional argument of a number, boolean, or string that will be converted into an object. If this argument is not specified, then a new object with no defined properties is created.
Returns
Nothing.
Description
Constructor; creates a new Object object
Similar to an Array object; however, the properites of an Object object are accessed by name using the dot operator, or by string
using the array access operator []
Sample
x = new Object;
x.greeting = "Hello";
y = x["greeting"];
trace(y); // displays "Hello" in the debug window
trace(x.greeting); // displays "Hello" in the debug window
x = new Object("Hello");
trace(x); // The optional 'value' argument is not supported by the Internal SWiSH player - you will need to use Test in Browser/Player to view it functional. It 'would' display "Hello" in the debug window if it were supported.
days = new Object;
days["M"] = "Monday";
days["Tu"] = "Tuesday";
days["W"] = "Wednesday";
days["Th"] = "Thursday";
abbrev = "Tu";
days[abbrev] contains "Tuesday"