# onEnterFrame in functions

**URL:** <https://forum.kirupa.com/t/onenterframe-in-functions/163599>\
**Category:** flash\
**Created:** [September 23, 2005, 7:00pm UTC](https://forum.kirupa.com/t/onenterframe-in-functions/163599 "2005-09-23T19:00:27Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sammo](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/sammo/32/779_2.png) [@Sammo](https://forum.kirupa.com/u/Sammo)\
**Post date:** [September 23, 2005, 7:00pm UTC](https://forum.kirupa.com/t/onenterframe-in-functions/163599/1 "2005-09-23T19:00:27Z")

</div>

Is there any way to perform a the contents of a function every frame? Take this code for a simple example:

```auto
function test(string) {
    this.onEnterFrame = function () {
        trace(string);
    }
}

```

Doesn’t work, anybody know a way that the same thing will work?
