# \[AS2\] onEnterFrame Problem on an .as file

**URL:** <https://forum.kirupa.com/t/as2-onenterframe-problem-on-an-as-file/214608>\
**Category:** flash\
**Created:** [January 30, 2007, 3:20pm UTC](https://forum.kirupa.com/t/as2-onenterframe-problem-on-an-as-file/214608 "2007-01-30T15:20:20Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![KILTRO](https://avatars.discourse-cdn.com/v4/letter/k/278dde/32.png) [@KILTRO](https://forum.kirupa.com/u/KILTRO)\
**Post date:** [January 30, 2007, 3:20pm UTC](https://forum.kirupa.com/t/as2-onenterframe-problem-on-an-as-file/214608/1 "2007-01-30T15:20:20Z")

</div>

Hello

I think it could be simple to solve but i cant figure it out because im just starting with classes, so im posting here. The problem is that i want to excute a function on a class file every frame, but it just appears once when in test it. Here are the codes (i made a simple example to focus on the problem):

Class .as

```auto

class Repeat extends MovieClip {
    var Container:MovieClip;
    function Repeat (Target:MovieClip){
        this.Container = Target;
    }
    function Speak (){
        this.Container.onEnterFrame = this.Words();
    }
    function Words (){
        trace ("Bla bla bla bla")
    }
}

```

.fla code

```auto
 
var Holder:MovieClip = this.createEmptyMovieClip ("Holder",this.getNextHighestDepth());
var myRepeat = new Repeat(Holder);
myRepeat.Speak();

```

Any help will be appreciated  
Thanks in advance=)
