Im trying to create a very generic, very easy to use TextField subclass. I want it to be useable ‘out of the box’ without having to set any options beforehand. I also want the ability to set all kinds of options, if I choose.
I’m implementing this by having a static Object, for which you can set any number of variables.
For example you could set
obj.bold = true;
obj.bgColor = 0xffaabb;
obj.scrollbars = true;
This is turning out to be a pretty slick solution, thanks to dynamic variables.
The problem is after creating a TextField, I would like to reset all the options back to a known, default state. I’ve decided that undefined is good enough. So how to I delete all the dynamic variables from an object? Is there a simple function to delete all of them? Or failing that, is there at least a way to loop through all the dynamic variables, so I can delete them one by one?