Automatically move focus to next text box

Hi there, I’m trying to move the focus between text boxes, when I get to the end of one text box I would like the cursor to jump to the next one and also if the user presses delete when the cursor is at the start of the text box I would like the cursor to move to the end of the previous line. I have set maximum chars per line:
[INDENT]var maxCharsPerLine:Number = 10;
if (lineOne_txt.length == maxCharsPerLine) {
trace(“chars recahed”);
}[/INDENT]
and then a bunch of else if statements to move the focus around e.g.
[INDENT]if (lineThree_txt.text == “” && Key.isDown(Key.BACKSPACE) && lineTwo_txt.text.length>=1) {
Selection.setFocus(“lineTwo_txt”);
}[/INDENT]

but this seems to be a bit complicated for quite a simple thing, also when the focus goes back to the previous line (after pressing delete) all characters in that line are removed.

I am sure I am trying to do something very simple in a very convoluted way, could some one show me the wood for the trees please?

thanks in advance

hectors