# Extending the movieClip Class

**URL:** <https://forum.kirupa.com/t/extending-the-movieclip-class/170033>\
**Category:** flash\
**Created:** [November 22, 2005, 4:36am UTC](https://forum.kirupa.com/t/extending-the-movieclip-class/170033 "2005-11-22T04:36:37Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Thinker2501](https://avatars.discourse-cdn.com/v4/letter/t/e0b2c6/32.png) [@Thinker2501](https://forum.kirupa.com/u/Thinker2501)\
**Post date:** [November 22, 2005, 4:36am UTC](https://forum.kirupa.com/t/extending-the-movieclip-class/170033/1 "2005-11-22T04:36:37Z")

</div>

Hi all,

So I’m trying to extend the movieClip() class and assign an onEnterFrame function as follows:

class MovableCharacter extends MovieClip {  
var mc:MovieClip;

```
public function MovableCharacter (mc, tW, tH, i, j) {
	this.mc = mc;
	mc.attachMovie ("char", "char", mc.getNextHighestDepth());
	mc.char._x = tW * j + Math.floor(mc.char._width/2) + (tW - mc.char._width);
	mc.char._y = tH * i + Math.floor(mc.char._height/2) + (tH - mc.char._height);
}

/* MOVEMENT function*/
public function onEnterFrame () {
	this._x += 4;
	_root.output.text = "enterFrame";
}

```

}

for some reason the onEnterFrame() is not being called. I got the idea for this struction from the OOP version of the snow tutorial. If anyone that can tell me what is up with extending the movieClip class like this I will be stoked. Thanks.
