# registerClass nightmare!

**URL:** <https://forum.kirupa.com/t/registerclass-nightmare/207656>\
**Category:** Uncategorized\
**Created:** [November 20, 2006, 1:05pm UTC](https://forum.kirupa.com/t/registerclass-nightmare/207656 "2006-11-20T13:05:50Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ayman](https://avatars.discourse-cdn.com/v4/letter/a/dec6dc/32.png) [@Ayman](https://forum.kirupa.com/u/Ayman)\
**Post date:** [November 20, 2006, 1:05pm UTC](https://forum.kirupa.com/t/registerclass-nightmare/207656/1 "2006-11-20T13:05:50Z")

</div>

I always had problems with registerClass. Ok here goes. I have a class named “page”. I want to assign this class to a movieClip instance on the stage named “container”. Note that I have created this movieclip dynamically after run-time (using createEmptyMovieClip). I use registerClass to assign that class to the movieClip, but then I lose all the properties for the MovieClip class itself (i.e. \_x, \_y, \_alpha, \_width, etc)

What am I doing wrong? I know how to do this at design time, by specifying the class name at the linkage properties window for the symbol, but you see, I’m creating the movieclip during run-time. Anyone??

in the main timeline:

```auto
registerClass(container,Page)

```

the class:

```auto
 
dynamic class Page extends MovieClip{
 
 function Page() //constructor
 {
    trace("Entered Constructor") //displayed successfully
    trace(_x) //undefined!!
 } 
 
 
 

```
