# \[AS2\] Can AS add components?

**URL:** <https://forum.kirupa.com/t/as2-can-as-add-components/210332>\
**Category:** flash\
**Created:** [December 17, 2006, 10:12pm UTC](https://forum.kirupa.com/t/as2-can-as-add-components/210332 "2006-12-17T22:12:54Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mathminded](https://avatars.discourse-cdn.com/v4/letter/m/bb73d2/32.png) [@mathminded](https://forum.kirupa.com/u/mathminded)\
**Post date:** [December 17, 2006, 10:12pm UTC](https://forum.kirupa.com/t/as2-can-as-add-components/210332/1 "2006-12-17T22:12:54Z")

</div>

Can AS add components that aren’t already linked from the library? I’d like to add a comboBox component using just AS. I tried this and it didn’t work:  
[AS]createEmptyMovieClip(“dirChooser”,\_root.getNextHighestDepth());  
dirChooser.dirChoice = new ComboBox();  
dirChooser.dirChoice.addItem(“greater than”);  
dirChooser.dirChoice.addItem(“less than”);  
dirChooser.dirChoice.addItem(“equal to”);[/AS]

When I viewed objects in the debugger, it only had this:

> Movie Clip: Frame=0 Target=“\_level0.dirChooser”

I’ve looked at the following pages about combo boxes and can’t find an answer to my question:  
[LIST]  
[_][http://www.adobe.com/support/flash/action\_scripts/actionscript\_dictionary/actionscript\_dictionary215.html](http://www.adobe.com/support/flash/action_scripts/actionscript_dictionary/actionscript_dictionary215.html)  
[_][kirupa.com - Using Components to Create a Form](http://www.kirupa.com/developer/mx/components.htm)  
[\*][http://www.adobe.com/support/flash/applications/creating\_forms/index.html[/LIST]Any](http://www.adobe.com/support/flash/applications/creating_forms/index.html%5B/LIST%5DAny) help would be appreciated.

Thanks!

-Mathminded
