How do I extend an MX2004 component?

I have searched the forum far and wide, and cannot find a decent answer to this question. I’m looking to extend the TextArea component, I am trying like this so:


class QuestionBox extends mx.controls.TextArea {
     public function QuestionBox() {
          trace (this);
     }

     public function clear():Void {
          this.text = "";
     } 
}

in in my Flash Doc:


import QuestionBox;

var textBox:QuestionBox;

textBox.clear();

I don’t get any errors when I compile, but I’m not sure the class is actually linked to my component instance on the stage. You cannot modify the linkage identifier, so how am I supposed to get this done?

nothing wrong with it I believe…
It extends, the original won’t be affected, so don’t worrie about that.
Now you just need to import the assets, used by the original component in your library or it won’t give you anything visual.

check out the original’s class here:
C:\Program Files\Macromedia\Flash MX 2004\en\First Run\Classes\mx\controls\TextArea.as

And the components assets here:
C:\Program Files\Macromedia\Flash MX 2004\en\Configuration\ComponentFLA\StandardComponents.fla