var classname = "main";
//the name of class
var iproperty = "subproperty";
//the name of property
var imethod = "submethod";
//the name of method
main = function () {
};
//
main.subproperty = function() {
var a = arguments;
var len = a.length;
for (i=0; i<len; i++) {
trace(typeof a[i]+":"+a[i]);
}
};
main.prototype.submethod = function() {
var a = arguments;
var len = a.length;
for (i=0; i<len; i++) {
trace(typeof a[i]+":"+a[i]);
}
};
invokemet = function (classname, imethod) {
arguments.splice(0, 2);
var c = eval(classname);
var c=new c;
return c[imethod].apply(null, arguments);
};
invokepro = function (classname, iproperty) {
arguments.splice(0, 2);
return eval(classname)[iproperty].apply(null, arguments);
};
invokepro(classname, iproperty, "v", 12, false);
invokemet(classname, imethod, "me");
//the name of class
var iproperty = "subproperty";
//the name of property
var imethod = "submethod";
//the name of method
main = function () {
};
//
main.subproperty = function() {
var a = arguments;
var len = a.length;
for (i=0; i<len; i++) {
trace(typeof a[i]+":"+a[i]);
}
};
main.prototype.submethod = function() {
var a = arguments;
var len = a.length;
for (i=0; i<len; i++) {
trace(typeof a[i]+":"+a[i]);
}
};
invokemet = function (classname, imethod) {
arguments.splice(0, 2);
var c = eval(classname);
var c=new c;
return c[imethod].apply(null, arguments);
};
invokepro = function (classname, iproperty) {
arguments.splice(0, 2);
return eval(classname)[iproperty].apply(null, arguments);
};
invokepro(classname, iproperty, "v", 12, false);
invokemet(classname, imethod, "me");
回复Comments
作者:
{commentrecontent}