# Dynamiclly created buttons and script

**URL:** <https://forum.kirupa.com/t/dynamiclly-created-buttons-and-script/175223>\
**Category:** Uncategorized\
**Created:** [January 12, 2006, 5:44pm UTC](https://forum.kirupa.com/t/dynamiclly-created-buttons-and-script/175223 "2006-01-12T17:44:04Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![bhoward3](https://avatars.discourse-cdn.com/v4/letter/b/76d3ee/32.png) [@bhoward3](https://forum.kirupa.com/u/bhoward3)\
**Post date:** [January 12, 2006, 5:44pm UTC](https://forum.kirupa.com/t/dynamiclly-created-buttons-and-script/175223/1 "2006-01-12T17:44:04Z")

</div>

how can i add my button scripts (rollover, click etc) to a dynamically created movieclip. the dynamic movie then has a library based movie attached to it

ie  
createEmptyMovieClip(“BUTTON”+i, getNextHighestDepth());  
where = 100 + (i \* 100);  
attachMovie(“NAV\_BUTTON”, “BUTTON”+i , getNextHighestDepth(), {name:elename,\_x:where, \_y:100});

thanks for any direction
