How to load the text into dynamic text field?

I have a class and function and I have to load my text through class->function

here is my code

public function loadtext():void{

var text_arry:Array=new Array(xmldata.child(0).name);

student_name.text=String(text_arry);

}

I called this function inside my timeline action window. but it is not working
it said undefined… and something. please help me out from this problem