Questo è il codice per cancellare i campi e usare il tasto "Invio".
Codice PHP:
import mx.controls.Button;
import mx.controls.Label;
import mx.controls.TextInput;

var 
path:MovieClip this.createEmptyMovieClip("path"this.getNextHighestDepth());
var 
a:Array = [];
a.push(path.createClassObject(Label"title"0));
a.push(path.createClassObject(Label"userlabel"1));
a.push(path.createClassObject(Label"pwdlabel"2));
a.push(path.createClassObject(TextInput"kerio_username"3));
a.push(path.createClassObject(TextInput"kerio_password"4));
a.push(path.createClassObject(Button"login"5));
a.push(new LoadVars());

a[0].move(1010); a[0].text "login to kerio mailserver webmail:"a[0].autoSize "left";
a[1].move(1040); a[1].text "username:";
a[2].move(1070); a[2].text "password:";
a[3].move(8040); a[3].setSize(12022);
a[4].move(8070); a[4].setSize(12022); a[4].password true;
a[5].move(10100); a[5].label "log in";


function 
click (e:Object) {
    
a[6].kerio_username kerio_username.text;
    
a[6].kerio_password kerio_password.text;
    
a[6].send("https://my.kerio.server/default/dologin.php""_self""POST");
    
a[3].text "";
    
a[4].text "";
}
function 
keyDown (e:Object) {
    if (
Key.isDown(Key.ENTER)) {
        
click();
    }
}
a[5].addEventListener("click"this);
a[5].addEventListener("keyDown"this); 
Per il problema al 2° punto ho invece aggiunto la creazione di un movieclip che contenga il form, così se rimuovi il movieclip "path", dovresti risolvere il problema di visibilità al cambio di pagina.