Instance variable TextField + createTextField()

Hi all,

I am having a bit of a headache with regards to this problem

 
class A {
 
     private var tf:TextField;
     private var canvas:MovieClip
 
     public function A (target_mc:MovieClip)
     {
          this.canvas = target_mc;
          this.tf = canvas.createTextField("tf");
     }
 
}

Forgive the syntax as i dont have access to flash ATM.

Why is it that the above code does not work? I need reference to the textfield so i can apply different TextFormats depending on the state of target_mc.

Why does flash complain that Void is found where textField is expected?

Thanks :smiley: