Assign Class To created MC

Hey,

As we all know we can place an MC on stage and in the librarys linking setterings we can assign a class to it. In that class we can for exemple write this.y+=50 and the MC will move.

BUT, what happens when i create a MC by actionscript and want to assign a class to it?
Please dont answer that i should reference it by “var something:class=new class(mcName)” and use the referense to taget the mc by mcName.y+=50. Its the “this.y+=50” im looking for inside the class, not reference or targeting.

Is there any way to actually assign a class to an MC created by actionscript for real?

Thanks