Extends MovieClip type mismatch?

Hi there!

I’m really scratching my head right now…
Take a look…

This is class A

 
class A extends MovieClip
{
public function A()
{
}
}

And this is the code to create a movieClip (on the _root) based on class A

 
var a:A = _root.createEmptyMovieClip("dude",1);

This works. But then come class B:

 
class B extends MovieClip
{
public function B(createdBy:MovieClip)
{
this = createdBy.createEmptyMovieClip("dude",1);
}
}

And then the code to create it :

var b:B = new B(_root);

This “B” class send me a nice Type mismatch error because “this” is a B and “createdBy.createEmptyMovieClip(“dude”,1)” is a MovieClip. That’s strange… My class isn’t extending the MovieClip class?

What I’m trying to do is asign a MovieClip to a class. So that class IS actualy that movieClip. Somewhat like a component. In fact, I want to be able to create my movieClip with my class… so after I’ll be able to access it by the name I have given to the class, not the instance name of the movieClip.

So each instance of, let’s say B, will be accessible within the class. I know I could do something like :

 
class B extends MovieClip
{
public var mc:MovieClip;
public function B(createdBy:MovieClip)
{
mc = createdBy.createEmptyMovieClip("dude",1);
}
}

But I don’t know… why extends MovieClip in this case?
Because what I’m trying to do is a movieClip at the end…

I hope I don’t sound to confusing… :S
Thank you!