
Код:
this.setMyObjectClass = function() {
delete this.setMyObjectClass;
var MyObject = function () {
this.init();
};
var tmp = MyObject.prototype.__proto__=Object.prototype;
tmp.init = function() {
};
tmp.addProperty("val", function () {
return this.value;
}, function (value) {
this.value = value;
});
tmp.toString = function() {
return this.val;
};
_global.MyObject = MyObject;
ASSetPropFlags(_global, 'MyObject', 7, 1);
};
this.setMyObjectClass();
//
_root["item"] = new MyObject();
_root["item"]["val"] = "item_17";
_root["item"]["id"] = "17";
trace(_root["item"]);