// define a generic function for __resolve to call
myObject.myFunction = function (name) {
arguments.shift();
trace("Method " + name + " was called with arguments: " +
arguments.join(','));
};
// define the __resolve function
myObject.__resolve = function (name) {
// reserve the name "onStatus" for local use
if (name == "onStatus") {
return undefined;
}
var f:Function = function () {
arguments.unshift(name);
this.myFunction.apply(this, arguments);
};
// create a new object method and assign it the reference
this[name] = f;
// return the reference to the function
return f;
};
// test __resolve using undefined method names with parameters
myObject.someMethod("hello");
// output: Method someMethod was called with arguments: hello
myObject.someOtherMethod("hello","world");
// output: Method someOtherMethod was called with arguments: hello,world
Object.toString()
Availability
Flash Player 5.
Usage
myObject.toString() : String
Parameters
None.
Returns
A string.
Description
Method; converts the specified object to a string and returns it.
384
Chapter 6: ActionScript Core Classes
Need help?
Do you have a question about the FLEX-FLEX ACTIONSCRIPT LANGUAGE and is the answer not in the manual?