A standard recommendation is to separate view from controlling code. A good way to achieve this in Flex is to have a mxml class that contains nothing but view and to move all the controlling code to a superclass.
LoginScreen.mxml
<p:LoginScreenClass xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:p="path.to.LoginScreenClass.*" />
LoginScreenClass.as
package path.to.LoginScreenClass
{
import mx.containers.VBox;
public class LoginPanelClass extends VBox {}
}
