# Delete All Dynamic Variables

**URL:** <https://forum.kirupa.com/t/delete-all-dynamic-variables/280535>\
**Category:** flash\
**Created:** [January 28, 2009, 5:18pm UTC](https://forum.kirupa.com/t/delete-all-dynamic-variables/280535 "2009-01-28T17:18:22Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![BeerOclock](https://avatars.discourse-cdn.com/v4/letter/b/fbc32d/32.png) [@BeerOclock](https://forum.kirupa.com/u/BeerOclock)\
**Post date:** [January 28, 2009, 5:18pm UTC](https://forum.kirupa.com/t/delete-all-dynamic-variables/280535/1 "2009-01-28T17:18:22Z")

</div>

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

```auto

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?
