Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function addMethodsTo(cls:Class, methods:Object):void
- {
- for (var name:String in methods)
- {
- cls.prototype[name] = methods[name];
- cls.prototype.setPropertyIsEnumerable(name, false);
- }
- }
- addMethodsTo(Object, {o: function(sPrefix:String = ""):*
- {
- sPrefix == "" ? sPrefix = "---" : sPrefix += "---";
- var str:String = "";
- for (var i:*in this)
- {
- trace(sPrefix, i + " : " + this[i], " ");
- if (typeof(this[i]) == "object")
- this[i].o(sPrefix);
- }
- }});
- // usage:
- // myObject.o();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement