# Flash 8: Extending the movieClip Class

**URL:** <https://forum.kirupa.com/t/flash-8-extending-the-movieclip-class/170034>\
**Category:** flash\
**Created:** [November 22, 2005, 4:39am UTC](https://forum.kirupa.com/t/flash-8-extending-the-movieclip-class/170034 "2005-11-22T04:39:54Z")\
**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:39am UTC](https://forum.kirupa.com/t/flash-8-extending-the-movieclip-class/170034/1 "2005-11-22T04:39:54Z")

</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) {  
[INDENT]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 () {  
[INDENT]this.\_x += 4;  
\_root.output.text = “enterFrame”;[/INDENT]  
}[/INDENT]  
}

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.
