UP and DOWN arrow keys in on-screen keyboard

Hii all,
i am working on Flash player 8. i am designing on screen keyboard.
I am not getting any clue what code shud i write 4 UP & DOWN arrow keys.
What logic shud i apply for both. I am done with left & right arrow keys.
Textfield is dynamic.
How to move textfield cursor up or down???
Please give me some logic.???
Can i get the rows or columns for the text i am typing from on screen keyboard??

the codes i have written for left & right arrow are written below.

var output:TextField;
var rpart:textField="";
var lpart:String="";
function receiveOutput(evnt:Object):Void {
text=lpart;
//Handle left arrow input
if (evnt.data == “leftarrow”) {

		lpart=text.substring(0,text.length-1);
		rpart=text.substring(text.length-1, text.length)+rpart;
		}
	//Handle right arrow input	
	else if(evnt.data=="rightarrow"){

	lpart+=rpart.substring(0,1);
	rpart=rpart.substring(1,rpart.length);}

       //and getting the output in textfield as

            output.htmlText = lpart+"|"+rpart;

===========================================================
Kindly help!!!