# Adding an onPress function

**URL:** <https://forum.kirupa.com/t/adding-an-onpress-function/281956>\
**Category:** Uncategorized\
**Created:** [February 16, 2009, 3:56am UTC](https://forum.kirupa.com/t/adding-an-onpress-function/281956 "2009-02-16T03:56:39Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![yani](https://avatars.discourse-cdn.com/v4/letter/y/e9c0ed/32.png) [@yani](https://forum.kirupa.com/u/yani)\
**Post date:** [February 16, 2009, 3:56am UTC](https://forum.kirupa.com/t/adding-an-onpress-function/281956/1 "2009-02-16T03:56:39Z")

</div>

I’m trying to add an onPress function to something that I’ve just dynamically attached to the stage.

```auto
item.attachMovie("close_btn", close_btn, this.getNextHighestDepth());

```

thanks for any help!
